ERRLOG2 (located in \TOOLKIT\SAMPLES\SYSMGT\ERRLOG\ERRLOG2) demonstrates how to use the following functions to open event notification, wait on an error log event, change an event filter, and then close event notification.
LogOpenEventNotification
LogWaitEvent
LogChangeEventFilter
LogCloseEventNotification
The program displays a message after each error logging function call indicating whether the call was successful or not. Because this program is using the event notification functions, it will pause twice as it's waiting for an error to be logged. At this time it will display a message indicating that it is waiting for an event.
When event notification is started a filter is not specified. Therefore, on the first use of LogWaitEvent, any record placed in the log will cause the notification to occur. The LogChangeEventFilter function is then used to filter on records where the vendor tag field contains IBM or the severity of the error is less than, or equal, to 2. In either case, the FFSTProbe sample program (PROBE.EXE) will cause the notification to occur.
To run ERRLOG2, do the following:
ERRLOG2
It will run to the point where it displays a message stating that it is waiting for an event.
PROBE
The ERRLOG2 program will display messages stating that it has received an event, that it's changing the event filter, and that it is waiting for an event.
The ERRLOG2 program will again display a message stating that it has received an event, followed by a message stating that it is closing event notification.