Databases Reference
In-Depth Information
APEX_APPLICATION.G_DEBUG
The
APEX_APPLICATION
package enables users to take advantage of global variables.
The
apex_application.g_debug
variable refers to whether debugging is currently
switched on or off. Valid values for this variable are
TRUE
or
FALSE
.
Turning debug
ON
shows details about application processing.
For example:
IF apex_application.g_debug THEN
apex_debug_message.log_message('Custom Validation');
END IF;
Including the preceding code in the APEX page, anywhere where PL/SQL is
allowed, will add information visible in
APEX_DEBUG_MESSAGES
, and therefore
in the
View Debug
page. This information will only be added when
apex_
application.g_debug
evaluates to
TRUE
.
The debug Advanced Programming
Interface (API)
The
APEX_DEBUG_MESSAGE
package provides utility functions for managing the
debug message log. Speciically, this package provides the necessary APIs to
instrument and debug PL/SQL code contained within the APEX application as well
as the PL/SQL code in database stored procedures and functions. Sometimes, you
need to know where the problem resides. A problem can exist in the rendering part
or in the processing part of the page. Using the API, debug messages can be included
at page rendering and page processing level.
Page rendering
: before header,
page
processing
: after submit.
The APEX debug message
There are several procedures in the
APEX_DEBUG_MESSAGE
package. These procedures
are listed in the following table:
Procedure
Usage
DISABLE_DEBUG_MESSAGES
Programmatically disable debugging
ENABLE_DEBUG_MESSAGES
Programmatically enable debugging
LOG_MESSAGE
Log a message of up to 4000 bytes at a given level
LOG_LONG_MESSAGE
Log a
LONG
message (split into 4000 byte chunks) at a
given level