Oracle Apex - Debug (Messages)

1 - About

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

3 - Level

3.1 - 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

3.2 - Initialization

3.2.1 - 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

3.2.2 - 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;

3.3 - Reference

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

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

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

5 - Messages

5.1 - 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; 

5.2 - Remove

See the following procedure:

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

5.3 - View


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap