How to write text into the Activity Log from the LOGEXIT.
search cancel

How to write text into the Activity Log from the LOGEXIT.

book

Article ID: 23028

calendar_today

Updated On:

Products

SOLVE:Operations Automation SOLVE:Access Session Management SOLVE:FTS SOLVE

Issue/Introduction

Problem:

The LOGEXIT allows to get control on messages before they are to be written into the Activity Log. If you want to write something into the Activity Log, &WRITE LOG=YES does not work. This Document explains what you can do instead.

 

Environment

Environment:  

Netmaster for TCP/IP, Netmaster for SNA, SOLVE:Operations, SOLVE:Access

 

Cause

Cause: 

Using &WRITE LOG=YES <message> or &WRITEL <message> in the Log exit will create message N10101 COMMAND &WRITE NOT RECOGNIZED but does not write into the Activity log.

 

Resolution

You cannot use &WRITE LOG=YES or &WRITEL from within the Log exit. The reason for that is that the Log exit is already executed by Background user BLOG. That user does not have a real OCS-Window where he could write something, therefore you would see message "N10101 COMMAND &WRITE NOT RECOGNIZED" in the Activity Log when using &WRITE. Instead, you need to use the SUBMIT-Command as follows (the dash '-' in front of the SUBMIT avoids message "L START SUBMIT BLOG CMD=&WRITE DATA=<message>" to appear in the OCS):

-SUBMIT BLOG LOG DATA=<message>

or

-SUBMIT BSYS LOG DATA=<message>

This will write <message> into the Activity log in the form:

===> LOG ENTRY: <message>

Additional Information

Here is an example of the LOGEXIT - 

&CONTROL NOLABEL                                           
*-                                                         
*-                                                         
&PARSE DELIM=' ' VARS=#LO$WORD* DATA=&#LO$RECORD           
                                                           
&IF .&#LO$WORD4 EQ .N20E05   &THEN +                       
&DO                                                        
    SUBMIT BLOG LOG DATA=&#LO$WORD5 &#LO$WORD6 &#LO$WORD11 
&DOEND                                                     
&RETURN                


Don't WRITE out the SAME WORD that you are searching for, this will cause a LOOP.