This module makes the Windows NT event log accessible to your Perl programs. It allows you to create new records, read records, and create backup logfiles. The new constructor opens a server's event log as an object:
$log = Win32::EventLog->new(source, [server]);
This function opens an event log and returns an object reference. source specifies the name of the source event, and server specifies the name of the server (local is assumed if no server name is given).
Many of the methods for this module require a reference to an empty variable as an argument. This is how the return value of the method will be placed, whether it is a hash or a scalar. The following methods can be used on event log objects.
$log->Read(flags, offset, \%eventinfo)
Reads an entry from the event log and returns the information in the eventinfo hash. offset specifies the record number you want to start at in the log. flags sets options for how you want to read the log, which can be any combination of the following:
The final argument is the output object for the event read. eventinfo is a reference to a hash that contains keys for each part of the event description. This same structure is used when you report new events to the event log using the Report method. The eventinfo hash looks like this:
%event = ( EventID => val, EventType => val, Category => val, ClosingRecordNumber => val, Source => val, Computer => val, Strings => val, Data => val, );
Copyright © 2002 O'Reilly & Associates. All rights reserved.