About
The debug facility displays application processing details through messages that can be:
Articles Related
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:
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:
- apex_debug.c_log_level_info is a constant of the debug package
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:
- since 4.2 APEX_DEBUG
- before APEX_DEBUG_MESSAGE
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
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
- metadata view: APEX_DEBUG_MESSAGES