2.11. Debugging applications in odo


With odo, you can attach a debugger to remotely debug your application. This feature is only supported for NodeJS and Java components.

Components created with odo run in the debug mode by default. A debugger agent runs on the component, on a specific port. To start debugging your application, you must start port forwarding and attach the local debugger bundled in your Integrated development environment (IDE).

2.11.1. Debugging an application

You can debug your application on in odo with the odo debug command.

Procedure

  1. After an application is deployed, start the port forwarding for your component to debug the application:

    $ odo debug port-forward
  2. Attach the debugger bundled in your IDE to the component. Instructions vary depending on your IDE.

2.11.2. Configuring debugging parameters

You can specify a remote port with odo config command and a local port with the odo debug command.

Procedure

  • To set a remote port on which the debugging agent should run, run:

    $ odo config set DebugPort 9292
    注意

    You must redeploy your component for this value to be reflected on the component.

  • To set a local port to port forward, run:

    $ odo debug port-forward --local-port 9292
    注意

    The local port value does not persist. You must provide it every time you need to change the port.

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.