23.5 Utilizing Debug Mode

Use Debug mode to track down unexpected application behavior.

See Also:

"APEX_DEBUG" in Oracle Application Express API Reference

23.5.1 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 you run an application 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.

23.5.2 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.

23.5.3 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. As long as the browser tab or window stays open, when you run a page from App Builder, it will use the current debug mode and level.

  5. You can also specify a Debug Level:
    1. On the Runtime Developer Toolbar, click Developer Toolbar Options and then Default Debug Level.
    2. From the submenu, select one of the following:
      • Info (default) - The debug log contains the default or normal amount of information. This corresponds with a log level of 4 and a Debug URL argument of YES.
      • App Trace - The debug log contains messages up to level 6. This corresponds with a Debug URL argument of LEVEL6.

      • Full Trace - The log will contain the maximum amount of information. This corresponds with a Debug URL argument of LEVEL9. Full Trace can slow request processing but provides the most amount of detail.

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

23.5.4 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.

23.5.5 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

23.5.6 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.

23.5.7 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.