Previous Topic: Swap the Online Log

Next Topic: Online Logging Procedure


Online Log Exit

You can create an NCL procedure to intercept, analyze, and react to the messages that are sent to the activity log.

Use the LOGFILES parameter group in Customizer to specify the name of your exit.

The exit is executed every time a message is sent to the log. Using the exit to perform complex functions can degrade the performance of the region.

Note: Ensure that your log exit procedure is well-tested before you put it into production.

Variables Available to the Activity Log Exit

The following variables are available to the activity log exit:

&#LO$RECORD

Contains records of the following formats:

time_generated user_id terminal_id message_text

The text of the message starts at the fourth word of the record.

arrival_time origin region $$AOMTIME$$ aom_time message_text

The text of the message starts at the sixth word of the record. This format lets you identify AOM-sourced messages.

You can change the contents of this variable. To suppress the message from the log, set the variable to NOLOG.

Note: For more information, see the &LOGREAD verb in the Network Control Language Reference Guide.

$LOG

Specifies a Mapped Data Object (MDO) that contains the message attributes. The MDO is mapped by the $MSG map.

You can use the &ASSIGN verb to query the MDO.

Note: For information about querying MDO components and additional variables, see the Network Control Language Programming Guide.

Example: Remove Messages from the NCL Log

The following shows an example procedure:

&CONTROL
-*------------------------------------------------* 
-* TO REMOVE IKJ56247I MESSAGES FROM THE NCL LOG. * 
-*------------------------------------------------* 
&PARSE DELIM=' ' VARS=#LO$WORD* DATA=&#LO$RECORD 
&IF .&#LO$WORD4 EQ .IKJ56247I &THEN + 
	&#LO$RECORD = NOLOG

Enable the Log Exit

To enable the log exit

  1. Enter /PARMS at the prompt.

    The Customizer : Parameter Groups list appears.

  2. Enter U beside the LOGFILES parameter group.

    The Customizer : Parameter Group panel for the LOGFILES parameter group appears.

  3. Enter the name of your activity log exit in the Log Exit Name field.
  4. Press F6 (Action).

    The changes are applied.

  5. Press F3 (File).

    The changes are saved.