17.12 LOG_LONG_MESSAGE Procedure

Use this procedure to emit debug messages from PLSQL components of Application Express, or PLSQL procedures and functions. This procedure is the same as LOG_MESSAGE, except it allows logging of much longer messages, which are subsequently split into 4,000 character chunks in the debugging output (because a single debug message is constrained to 4,000 characters).

Note:

Instead of this procedure, use "ERROR Procedure," "WARN Procedure," "MESSAGE Procedure," "INFO Procedure," "ENTER Procedure," or "TRACE Procedure."

Syntax

APEX_DEBUG.LOG_LONG_MESSAGE (
    p_message    IN VARCHAR2  DEFAULT NULL,
    p_enabled    IN BOOLEAN   DEFAULT FALSE,
    p_level      IN T_LOG_LEVEL DEFAULT C_LOG_LEVEL_APP_TRACE);

Parameters

Table 17-6 APEX_DEBUG.LOG_LONG_MESSAGE Procedure Parameters

Parameter Description

p_message

Log long message with maximum size of 32767 bytes.

p_enabled

Set to TRUE to always log messages, irrespective of whether debugging is enabled. Set to FALSE to only log messages if debugging is enabled.

p_level

Identifies the level of the long log message. See "Constants."

Example

This example shows how to enable debug message logging for 1 and 2 level messages and display a level 1 message that could contain anything up to 32767 characters. Note, the p_enabled parameter need not be specified, as debugging has been explicitly enabled and the default of FALSE for this parameter respects this enabling.

DECLARE
    l_msg VARCHAR2(32767) := 'Debug outputs anything up to varchar2 limit';
BEGIN
    APEX_DEBUG.ENABLE (p_level => 2);
    
    APEX_DEBUG.LOG_LONG_MESSAGE(
        p_message => l_msg,
        p_level => 1 );     
END;