programming-examples/perl/Win32/An Event Report.pl

18 lines
573 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
use Win32::EventLog;
$eventLog = Win32::EventLog->new('System') || die $!;
%eventRecord = (
'Source' => 0,
'Computer' => 0,
'Length' => 0,
'RecordNumber' => 0,
'TimeGenerated'=> 0,
'Timewritten' => 0,
'ClosingRecordNumber' => 0,
'Category' => 2,
'EventID' => 4242,
'EventType' => EVENTLOG_INFORMATION_TYPE,
'Strings' => "Used to identify the data",
'Data' => "Informational data about the message",
);
$eventLog->Report(\%eventRecord);