Oracle Apex - Debug (Messages)

Card Puncher Data Processing

About

The debug facility displays application processing details through messages that can be:

Level

Definition

See constant of the debug package

Level Name Description PL/SQL 4.2 Message
1 error critical error Error
2 warn less critical error Warn
4 info default level if debugging is enabled (for example, used by apex_application.debug) Info
5 app_enter application: messages when procedures/functions are entered Enter
6 app_trace application: other messages within procedures/functions Trace
8 engine_enter Application Express engine: messages when procedures/functions are entered
9 engine_trace Application Express engine: other messages within procedures/functions

Initialization

URL

Through the Apex URL

Valid values for the DEBUG flag include:

Values Description
LEVELn Enable debug with the level n of debug detail (between 1 and 9)
YES Enable debug with the level 4
NO Disable debug

API

Enabled:

BEGIN
    APEX_DEBUG.ENABLE(apex_debug.c_log_level_info);
    -- Before 4.2: APEX_DEBUG_MESSAGE.ENABLE_DEBUG_MESSAGES (apex_debug.c_log_level_info);
END;

where:

Disabled

BEGIN
    APEX_DEBUG.DISABLE();
END;

Reference

You can reference the Debug level flag using the following syntax:

  • Short substitution string: &DEBUG.
  • PL/SQL: V('DEBUG')
  • Bind variable: :DEBUG

API

Package:

This package provides APIs to instrument and debug PL/SQL code:

  • contained within your Application Express application
  • as well as in database stored procedures and functions.

Messages

Add

The MESSAGE Procedure

since 4.2

is the main procedure to add messages to different levels.

There is also shortcut procedure for each level

Example: Enter: level 5

procedure foo ( 
    p_widget_id in number, 
    p_additional_data in varchar2, 
    p_emp_rec in emp%rowtype ) 
is 
begin 
    apex_debug.enter('foo', 
        'p_widget_id' , p_widget_id, 
        'p_additional_data', p_additional_data, 
        'p_emp_rec.id' , p_emp_rec.id ); 
....do something.... 
end foo; 

Remove

See the following procedure:

  • REMOVE_DEBUG_BY_AGE Procedure
  • REMOVE_DEBUG_BY_APP Procedure
  • REMOVE_DEBUG_BY_VIEW Procedure
  • REMOVE_SESSION_MESSAGES Procedure

View





Discover More
Card Puncher Data Processing
Oracle Apex - (Diagnostic|Troubleshooting)

See: Enabling Application Tracing by specifying &p_trace=YES on the URL when displaying a page. The ability to generate a trace file is already controlled if the application has Debug enabled....
Card Puncher Data Processing
Oracle Apex - URL

The format of the APEX URL and URL management. Where: pocserver01:7777...



Share this page:
Follow us:
Task Runner