The LOG statement writes a record to the event log or to the user trace.
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.
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;