Skip Menu |
 

This queue is for tickets about the Sys-Syslog CPAN distribution.

Report information
The Basics
Id: 90538
Status: resolved
Priority: 0/
Queue: Sys-Syslog

People
Owner: SAPER [...] cpan.org
Requestors: CITRIN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.31
Fixed in: 0.34



Subject: [regression] facility from openlog() is not used
Download (untitled) / with headers
text/plain 391b
This code pattern worked for years: use Sys::Syslog qw/ :DEFAULT :macros setlogsock /; setlogsock('unix'); openlog('test-case', 'ndelay,pid', LOG_LOCAL7); syslog(LOG_INFO, '%s', 'xxx1'); syslog(LOG_INFO, '%s', 'xxx2'); But in 0.33 it is no longer works - messages logged with wrong facility (zero). This code works at least in 0.27 and seems to be broken by 0.31 Possible fix attached.
Subject: patch-Syslog.pm.txt
--- Syslog.pm.old 2013-05-24 00:10:00.000000000 +0000 +++ Syslog.pm 2013-11-20 09:52:49.000000000 +0000 @@ -365,7 +365,9 @@ if ($priority =~ /^\d+$/) { $numpri = LOG_PRI($priority); - $numfac = LOG_FAC($priority) << 3; + $numfac = LOG_FAC($priority) << 3; + # undef to use default if facility is not given in syslog() + undef $numfac if $numfac == 0; # undef to use default } elsif ($priority =~ /^\w+/) { # Allow "level" or "level|facility".
Subject: Re: [rt.cpan.org #90538] [regression] facility from openlog() is not used
Date: Thu, 21 Nov 2013 00:56:36 +0100
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Anton Yuzhaninov wrote via RT: Show quoted text
> This code pattern worked for years: > > use Sys::Syslog qw/ :DEFAULT :macros setlogsock /; > > setlogsock('unix'); > > openlog('test-case', 'ndelay,pid', LOG_LOCAL7); > > syslog(LOG_INFO, '%s', 'xxx1'); > syslog(LOG_INFO, '%s', 'xxx2'); > > But in 0.33 it is no longer works - messages logged with wrong facility (zero). > This code works at least in 0.27 and seems to be broken by 0.31
Looking at the git log, it would make sense. Show quoted text
> Possible fix attached. > --- Syslog.pm.old 2013-05-24 00:10:00.000000000 +0000 > +++ Syslog.pm 2013-11-20 09:52:49.000000000 +0000 > @@ -365,7 +365,9 @@ > > if ($priority =~ /^\d+$/) { > $numpri = LOG_PRI($priority); > - $numfac = LOG_FAC($priority) << 3; > + $numfac = LOG_FAC($priority) << 3; > + # undef to use default if facility is not given in syslog() > + undef $numfac if $numfac == 0; # undef to use default > } > elsif ($priority =~ /^\w+/) { > # Allow "level" or "level|facility".
Thanks, applied. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
This issue should be fixed with version 0.34, just released. -- Close the world, txEn eht nepO.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.