Jump to content

LogChangeEventFilter: Difference between revisions

From EDM2
Created page with "LogChangeEventFilter is used to alter the filter that is associated with an event-notification request. In addition to changing the filter, you can specify current entries tha..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
LogChangeEventFilter is used to alter the filter that is associated with an event-notification request. In addition to changing the filter, you can specify current entries that are to be purged before the filter change takes effect.  
LogChangeEventFilter is used to alter the filter that is associated with an event-notification request. In addition to changing the filter, you can specify current entries that are to be purged before the filter change takes effect.


==Syntax==
==Syntax==
Line 5: Line 5:


==Parameters==
==Parameters==
; service (ULONG) - input : The class of Logging Service:
;service (ULONG) - input : The class of Logging Service:
:Error logging
:Error logging
:All other values are reserved for future use.  
:All other values are reserved for future use.
 
;pChangeEventFilter (PVOID) - input/output : A pointer to the LogChangeEventFilter parameter packet.
; pChangeEventFilter (PVOID) - input/output : A pointer to the LogChangeEventFilter parameter packet.
:For Error Logging, this is a pointer to a LCEFREQUEST structure.
: For Error Logging, this is a pointer to a LCEFREQUEST structure.


==Returns==
==Returns==
; rc (APIRET) - returns : Return code.
;rc (APIRET) - returns : Return code.
 
LogChangeEventFilter returns the following values:
LogChangeEventFilter returns the following values:
 
* 0 No error
* 0 No error  
* 523 Error lf invalid service
* 523 Error lf invalid service  
* 1703 Invalid data pointer
* 1703 Invalid data pointer  
* 1702 Invalid LF packet revision number
* 1702 Invalid LF packet revision number  
* 1706 RAS invalid parm packet ptr
* 1706 RAS invalid parm packet ptr  
* 1751 Invalid LF flag
* 1751 Invalid LF flag  
* 1758 RAS invalid log notify id
* 1758 RAS invalid log notify id  
* 1761 RAS invalid packet size
* 1761 RAS invalid packet size  
* 2503 RAS notif entry not found
* 2503 RAS notif entry not found  
* 2504 RAS notif entry deleted
* 2504 RAS notif entry deleted  
* 2505 RAS entry filter unchanged
* 2505 RAS entry filter unchanged


==Remarks==
==Remarks==
The library LFAPI.LIB must be linked with object files that use LogChangeEventFilter  
The library LFAPI.LIB must be linked with object files that use LogChangeEventFilter.


==Example Code==
==Example Code==
Line 44: Line 41:
rc = LogChangeEventFilter(service, pChangeEventFilter);
rc = LogChangeEventFilter(service, pChangeEventFilter);
</PRE>
</PRE>
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.  
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.
 
<PRE>
<PRE>
   #define INCL_LOGGING
   #define INCL_LOGGING
Line 81: Line 77:
* [[LogCloseEventNotification]]  
* [[LogCloseEventNotification]]  
* [[LogWaitEvent]]
* [[LogWaitEvent]]
* [[LogReadEntry]]  
* [[LogReadEntry]]
 


[[Category:FFST]]
[[Category:FFST]]

Latest revision as of 19:24, 1 March 2020

LogChangeEventFilter is used to alter the filter that is associated with an event-notification request. In addition to changing the filter, you can specify current entries that are to be purged before the filter change takes effect.

Syntax

LogChangeEventFilter(service, pChangeEventFilter);

Parameters

service (ULONG) - input
The class of Logging Service:
Error logging
All other values are reserved for future use.
pChangeEventFilter (PVOID) - input/output
A pointer to the LogChangeEventFilter parameter packet.
For Error Logging, this is a pointer to a LCEFREQUEST structure.

Returns

rc (APIRET) - returns
Return code.

LogChangeEventFilter returns the following values:

  • 0 No error
  • 523 Error lf invalid service
  • 1703 Invalid data pointer
  • 1702 Invalid LF packet revision number
  • 1706 RAS invalid parm packet ptr
  • 1751 Invalid LF flag
  • 1758 RAS invalid log notify id
  • 1761 RAS invalid packet size
  • 2503 RAS notif entry not found
  • 2504 RAS notif entry deleted
  • 2505 RAS entry filter unchanged

Remarks

The library LFAPI.LIB must be linked with object files that use LogChangeEventFilter.

Example Code

#define INCL_LOGGING
#include <os2.h>
#include <lfdef.h>

ULONG     service;
PVOID     pChangeEventFilter;
APIRET    rc;

rc = LogChangeEventFilter(service, pChangeEventFilter);

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;
     }

Related