Accessing Debugging 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 Developer Toolbar. To view Debug reports, click the View Debug link in the 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.

Topics:

Enabling and Disabling Debugging

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 the application's workspace can always run the application in debug mode.

To enable or disable debugging:

  1. On the Workspace home page, click the Application 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 Debugging Mode

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

To enable or disable Debug mode:

  1. On the Workspace home page, click the Application Builder icon.

  2. Run the application.

  3. On the Developer Toolbar, click Debug.

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

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

Using f?p Syntax to Access Debugging 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

To view a debug reports:

  1. On the Workspace home page, click the Application Builder icon.

  2. Select the desired application.

    You can view debug reports when the application is running or in development mode.

  3. To view a debug reports in development mode:

    • Click the Find icon and then the Debug tab. See "Using the Find Icon".

    • On the Application home page, click Utilities, and then Debug Messages.

  4. To view debug reports when the application is running, click View Debug on the Developer Toolbar.

    A list of Debug reports displays.

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

    The following illustration shows debug reports viewed in the Item Finder.

  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.