Subject: | Description for Event ID 157 cannot be found on Windows 7 |
Distribution: Sys::Syslog 0.32
Perl version: This is perl 5, version 16, subversion 1 (v5.16.1) built
for MSWin32-x64-multi-thread (ActivePerl)
OS: Windows 7 Enterprise SP1, 64-bit
When attempting to log messages from my script to the Windows Event Log,
I get the message:
"The description for Event ID 157 from source moseley-log-beautifier.pl
[SSW:1.0.1] cannot be found. Either the component that raises this event
is not installed on your local computer or the installation is
corrupted. You can install or repair the component on the local
computer.
If the event originated on another computer, the display information had
to be saved with the event.
The following information was included with the event:
Begin run on file "Z:\Log.txt"
the message resource is present but the message is not found in the
string/message table"
Expected behavior: Log messages show up in Event Log without the error
message. In the above example, "Begin run on file 'Z:\Log.txt'" would
be the only thing displayed in the Event Log".
Looking at PerlLog.mc (which, per README.Win32 is the default message
text file used by the module), I see:
MessageId = 0x009d
SymbolicName = MSG_LFMT
Language = English
Logalert facility: %1
.
Language = French
Message de logalert : %1
.
And this is under the heading "IRIX specific facilities".
Example code:
use Sys::Syslog qw/:standard :macros/;
Readonly my $LOG_FACILITY => Sys::Syslog::LOG_USER;
Readonly my $LOG_IDENTIFIER => q/moseley-log-beautifier/;
Readonly my $LOG_OPTIONS => $EMPTY;
BEGIN { # Start logging immediately
openlog( $LOG_IDENTIFIER, $LOG_OPTIONS, $LOG_FACILITY );
}
syslog( LOG_INFO, qq/Begin run on file "$transmitter_log"/ );
END {
closelog;
}