in reply to Win32::EventLog searching the wrong logs
Try and take a look at MyEventLog for Win32::EventLog, Re: Translating Win32 EventLog Category
I might add this constructor
sub Win32::EventLog::new { package Win32::EventLog; die "usage: PACKAGE->new(SOURCENAME[, SERVERNAME])\n" unless @_ > +1; my ( $class, $source, $server ) = @_; my $handle; my $error; # Create new handle if ( $source !~ /\\/ ) { my $ret = OpenEventLog( $handle, $server, $source ); $ret or $error = [ [ int $!, $!], [int $^E, $^E] ]; } else { my $ret = OpenBackupEventLog( $handle, $server, $source ); $ret or $error = [ [ int $!, $!], [int $^E, $^E] ]; } return bless { handle => $handle, Source => $source, Computer => $server, error => $error, } => $class; }
I also might add a check in this constructor for the behaviour you experience that is describe below (opens Application when it can't find what you ask for)
https://metacpan.org/source/JDB/Win32-EventLog-0.077/EventLog.xs
OpenEventLog function (Windows)lpEvtLog->hLog = OpenEventLogA(lpszUNCServerName,lpszSourceName);
lpSourceName [in]
The name of the log.
If you specify a custom log and it cannot be found, the event logging service opens the Application log; however, there will be no associated message or category string file.
The linked example ( Querying for Event Information (Windows) ) says The source name (provider) must exist as a subkey of Application.
Regarding that comment one answer in How to open system event log? says For Vista or higher use EvtQuery, EvtNext etc to query the XML based event logs. and links to Querying for Events (Windows) using EvtQuery
Other answer links to WindowsNT Event Log Viewer - CodeProject which talks about the win32 registry
I've not deciphered the registry clues , but you might be able to :)
Enjoy :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Win32::EventLog searching the wrong logs
by FloydATC (Deacon) on May 02, 2014 at 08:09 UTC | |
by Anonymous Monk on May 02, 2014 at 08:53 UTC | |
by Anonymous Monk on May 02, 2014 at 08:55 UTC | |
by Anonymous Monk on May 02, 2014 at 09:00 UTC | |
by FloydATC (Deacon) on May 02, 2014 at 09:54 UTC | |
| |
by FloydATC (Deacon) on May 02, 2014 at 09:46 UTC | |
by FloydATC (Deacon) on May 02, 2014 at 09:43 UTC |