Utilizing Debug Mode

Use Debug mode to track down unexpected application behavior.

See Also:

"APEX_DEBUG" in Oracle Application Express API Reference

About Debug Mode

The Debug mode is a built in mechanism used to track down unexpected application behavior. You enable and disable debug mode for the current page and session by clicking the Debug and No Debug links in the Runtime Developer Toolbar. To view Debug reports, click the View Debug link in the Runtime Developer Toolbar.

If an application runs in debug mode, Oracle Application Express writes information about how it processes each page request to a log table. You can control the logging level of detail, add debug calls in your own code, and analyze the written log information.

When debug is enabled, Oracle Application Express also uses its non-minified JavaScript files to better isolate where possible issues may be coming from with client-side-code.

Enabling and Disabling Debug Mode for an Application

You can configure whether end users can run the application in debug mode by using the Debugging attribute on the Edit Application Definition page. A developer who is logged into workspace where the application resides can always run the application in debug mode.

To enable or disable debug mode:

  1. On the Workspace home page, click the App Builder icon.
  2. Select an application.
  3. Click the Edit Application Properties button to the right of the application name.

    The Edit Application page appears.

  4. Scroll down to Properties.
  5. For Debugging:
    • Yes. Enables the application debug mode using the browser at runtime.

    • No. Disables the application debug mode using the browser at runtime.

Running an Application in Debug Mode

You run and disable debug mode at runtime by clicking Debug and No Debug on the Runtime Developer Toolbar. By default, Debugging mode is disabled, unless you are logged into the application's workspace as a developer.

To enable or disable Debug mode at runtime:

  1. On the Workspace home page, click the App Builder icon.
  2. Select the desired application.
  3. Run the application.
  4. On the Runtime Developer Toolbar, click Debug.

    The debugging mode is enabled. Debug data is captured in the background.

  5. To disable debug mode, on the Runtime Developer Toolbar, click No Debug.

Viewing Debug Reports in Development Mode

To view debug reports in development mode:

  1. On the Workspace home page, click the App Builder icon.
  2. Select the desired application.
  3. Click Utilities.
  4. On the Utilities page, click Debug Messages.

    The Debug page appears.

  5. Click the View Identifier to the left of the session you want to view.

    The Debug Message Data page appears.

  6. To view steps that took the longest, hover over that step on the graph above the report.

    The step details display.

  7. To go to that step in the report, click the bar.

    Note:

    Debug sessions listed in the report live for at least 2 weeks and age out along with the activity log. This is usually more than adequate for debugging purposes.

About Using f?p Syntax to Access Debug Mode

You can also use f?p syntax to run an application in Debugging mode. Simply call the page and set the Debug argument to YES or LEVELn, where n is between 1 (least detailed) and 9 (most detailed). For example:

f?p=100:1:&APP_SESSION.::YES

Viewing Debug Reports from a Running Application

To view debug report from a running application:

  1. Locate and run the application in Debug mode.
  2. Click View Debug on the Runtime Developer Toolbar.

    A list of Debug reports displays.

  3. Click the View Identifier to the left of the session you want to view.

    The Debug Message Data page appears.

  4. To view steps that took the longest, hover over that step on the graph above the report.

    The step details display.

  5. To go to that step in the report, click the bar.

    Note:

    Debug sessions listed in the report live for at least 2 weeks and age out along with the activity log. This is usually more than adequate for debugging purposes.

Viewing Debug Reports

To view debug reports:

  1. Click the Find icon.
  2. Click the Debug tab.
  3. Click the View Identifier to the left of the session you want to view.

    The Debug report appears.

  4. To view steps that took the longest, hover over that step on the graph above the report.

    The step details display.

  5. To go to that step in the report, click the bar.

    Note:

    Debug sessions listed in the report live for at least 2 weeks and age out along with the activity log. This is usually more than adequate for debugging purposes.