Databases Reference
In-Depth Information
Listing 6-4. Using P_ENABLED to Always Log a Message
BEGIN
--
APEX_DEBUG_MESSAGE.LOG_MESSAGE( P_MESSAGE =>'THIS MESSAGE IS ALWAYS LOGGED...',
P_ENABLED=>TRUE, P_LEVEL=>3);
--
APEX DEBUG MESSAGE.LOG MESSAGE( P MESSAGE =>'START - INSERTING 10000 RECORDS...', P LEVEL=>5);
--
FOR I IN 1..10000 LOOP
--
APEX DEBUG MESSAGE.LOG MESSAGE( P MESSAGE =>'START RECORD '||I, P LEVEL=>7);
--
INSERT INTO PERF TEST (guid1, guid2, guid3, created on)
VALUES (SYS GUID, SYS GUID, SYS GUID, SYSDATE);
--
APEX DEBUG MESSAGE.LOG MESSAGE( P MESSAGE =>'END RECORD '||I, P LEVEL=>7);
--
END LOOP;
--
APEX DEBUG MESSAGE.LOG MESSAGE( P MESSAGE =>'END - INSERTING 10000 RECORDS...', P LEVEL=>5);
--
END;
Logging Session State
There are many instances when trying to debug a page where it would be beneficial to know
specifically what was in session state. The LOG_PAGE_SESSION_STATE procedure will provide you
exactly that information.
The API will emit information into the DEBUG logs, which shows the session state for each item on
the designated page. Like the LOG_MESSAGE procedure, the LOG_PAGE_SESSION_STATE procedure
lets you dictate what log level will be associated with the emitted log records, and allows you to decide
whether to override the debug setting and always log the session state.
You can call the LOG_PAGE_SESSION_STATE procedure without passing any parameters and it will
log the session state for the currently processing page at debug message level 7, but it will only do so if
debugging is enabled.
Figure 6-25 show an example of the output of debug information that contains session state
information. The session state information is specifically contained in rows 2 through 6 in the report.
Search WWH ::




Custom Search