Subject: | Bug report / partial patch for Sys::Syslog 0.27 |
Date: | Tue, 2 Mar 2010 10:22:42 -0800 |
To: | bug-sys-syslog [...] rt.cpan.org |
From: | Tim Jenkins <tim [...] sendgrid.com> |
Hello,
While doing some testing between my perl 5.8.8 install and perl 5.10 I
found that when I executed
openlog("myprog", "ndelay", "mail");
syslog("local0|info", "my message");
the message was still being logged to the mail facility. I upgraded to
Sys::Syslog version 0.27, and the issue still persisted.
After a bit of hunting, I realized it was because the code was using
the native connection method, which only looks at the priority
argument, not the facility. I changed the definition to:
sub _syslog_send_native {
my ($buf, $numpri, $numfac) = @_;
syslog_xs($numpri|$numfac, $buf);
return 1;
}
and that worked.
Can you please make this change to the next version of Sys::Syslog?
Also, I found that if I tried to execute
syslog(LOG_LOCAL0|LOG_INFO, "my message")
I got an error
syslog: level must be given
This is because the routine to read the priority seems to assume it
will be in word format, and therefore doesn't handle the macros. I
could submit a patch for that as well, but since I got what I needed
working I haven't looked at the best way to solve that. I will if you
want some help though.
Please let me know if you have any questions.
Regards,
Tim