The following example changes the event-notification filter for an event notification to a NULL filter (that is, any Error Log entry that is logged will cause an event notification to be sent). The sample will also purge any event notifications that might be pending at the time the LogChangeEventFilter call is made.
#define INCL_LOGGING
#include <unidef.h>
#include <os2.h>
#include <stdio.h>
#include <lfdef.h>
{
APIRET rc; /* return code */
ULONG service;
LCEFREQUEST change_event_filter_packet;
HLOGNOTIFY log_notify;
service = ERROR_LOGGING_SERVICE;
/* Construct the LogChangeEventFilter parameter packet */
change_event_filter_packet.packet_size = sizeof(LCEFREQUEST);
change_event_filter_packet.packet_revision_number = LF_UNI_API;
change_event_filter_packet.purge_flags = PURGE_EVENT_NOTIFICATION;
change_event_filter_packet.LogNotify = log_notify;
change_event_filter_packet.pFilter = NULL;
rc = LogChangeEventFilter(service, /* service */
&change_event_filter_packet) /* parameter packet*/
if (rc |= 0)
{
printf("LogChangeEventFilter error: return code = %d",rc);
return;
}