This writes entries to the event log just fine. The source does NOT haveto be registered in the Registry, but you can follow shonorio's advice.use strict; writeeventlog(); ###################################### sub writeeventlog { use Win32::EventLog; my $eventLog = Win32::EventLog->new('MyProgram'); my %eventRecord = ( #'Source' => undef, #'Computer' => undef, 'Category' => 0, #NULL, 'EventID' => 0, 'EventType' => EVENTLOG_ERROR_TYPE, 'Strings' => 'Test.', 'Data' => 'Test.', ); $eventLog->Report(\%eventRecord); $eventLog->Close(); }
The Eventviewer message is an attempt to decode the EventID, but since you do not have a message file or DLL associated with your app, you will need to ignore the Event viewers failed attempt to provide a "description" for your eventID.
"Man cannot live by bread alone...
He'd better have some goat cheese and wine to go with it!"
In reply to Re: Write to WIndows Event Log
by NetWallah
in thread Write to WIndows Event Log
by sungy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |