WebSphere Message Brokers
File: ak05075_
Writer: John Prowse

Reference topic

This build: July 31, 2007 21:31:32

LOG statement

The LOG statement writes a record to the event log or to the user trace.

Syntax

CATALOG
CATALOG is an optional clause; if you omit it, it defaults to the WebSphere Message Broker current version catalog. To use the current WebSphere Message Broker version message catalog explicitly, use BIPV600 on all operating systems.
EVENT
A record is written to the event log, and also to the user trace, if user tracing is enabled.
EXCEPTION
The current exception, if any, is logged.
FULL
The complete nested exception report is logged, just as if the exception had reached the input node. If FULL is not specified, any wrapping exceptions are ignored, and only the original exception is logged. Therefore, you can have either a full report or simply the actual error report without the extra information regarding what was going on at the time. Note that a current exception only exists within handler blocks (see Handling errors in message flows).
MESSAGE
The number of the message to be used. If specified, the MESSAGE clause can contain any expression that returns a non-NULL, integer, value.

If you omit MESSAGE, its value defaults to the first message number (2951) in a block of messages that is provided for use by the LOG and THROW statements in the WebSphere Message Broker catalog. If you specify a message number, you can use message numbers 2951 thru 2999. Alternatively, you can generate your own catalog.

SEVERITY
The severity associated with the message. If specified, the SEVERITY clause can contain any expression that returns a non-NULL, integer, value. If you omit the clause, its value defaults to 1.
USER TRACE
A record is written to the user trace, whether user trace is enabled or not.
VALUES
Use the optional VALUES clause to provide values for the data inserts in your message. You can insert any number of pieces of information, but the messages supplied (2951 - 2999) cater for a maximum of ten data inserts.

Note the general similarity of the LOG statement to the THROW statement.

  -- Write a message to the event log specifying the severity, catalogue and message
  -- number. Four inserts are provided
  LOG EVENT SEVERITY 1 CATALOG 'BIPv600' MESSAGE 2951 VALUES(1,2,3,4);

  -- Write to the trace log whenever a divide by zero occurs
  BEGIN
    DECLARE a INT 42;
    DECLARE b INT 0;
    DECLARE r INT;

    BEGIN
      DECLARE EXIT HANDLER FOR SQLSTATE LIKE 'S22012' BEGIN
        LOG USER TRACE EXCEPTION VALUES(SQLSTATE, 'DivideByZero');

        SET r = 0x7FFFFFFFFFFFFFFFF;
      END;

      SET r = a / b;
    END;

    SET OutputRoot.XMLNS.Data.Result = r;
  END;
Related concepts
ESQL overview
Related tasks
Developing ESQL
Related reference
Syntax diagrams: available types
ESQL statements
RETURN statement
Example message
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:31:32

ak05075_ This topic's URL is: