Subject: | possible bug |
Date: | Wed, 30 May 2012 11:31:06 +0200 |
To: | bug-Sys-Syslog [...] rt.cpan.org |
From: | François Mommens <mommens [...] textkernel.nl> |
Hi,
there seems to be a bug with the Sys::Syslog module when used through
the Log::Dispatch::Syslog log4perl appender and the log4perl fatal()
method. Sys::Syslog croaks at line 383 ("syslog: level must be given")
and so no log line is produced.
How to reproduce:
perl script:
use Log::Log4perl qw/ get_logger /;
Log::Log4perl::init_and_watch("log4perl.conf", 30);
my $logger = get_logger();
$logger->error('error');
$logger->fatal('fatal');
log4perl.conf:
log4perl.appender.STDERR = Log::Log4perl::Appender::Screen
log4perl.appender.STDERR.layout = PatternLayout
log4perl.appender.STDERR.layout.ConversionPattern = %d{yyyy-MM-dd
HH:mm:ss} %p %s [%P] %C(%L): %m%n
log4perl.appender.STDERR.layout.cspec.s = sub { use File::Basename;
return basename($0) }
log4perl.appender.STDERR.stderr = 1
log4perl.appender.STDERR.utf8 = 1
log4perl.appender.Syslog = Log::Dispatch::Syslog
log4perl.appender.Syslog.Threshold = INFO
log4perl.appender.Syslog.ident = jobfeed_DE
log4perl.appender.Syslog.layout = PatternLayout
log4perl.appender.Syslog.layout.ConversionPattern = %p %s [%P] %c(%L): %
m%n
log4perl.appender.Syslog.layout.cspec.s = sub { use File::Basename;
return basename($0) }
log4perl.appender.Syslog.logopt = nodelay
log4perl.rootLogger = DEBUG, STDERR, Syslog
rsyslog configuration relevant part:
$template outputTemplate,"%timestamp% %hostname% %
syslogseverity-text:::uppercase% %syslogtag%%msg%\n"
*.* /tmp/log;outputTemplate
The error level log is produced, the fatal level not, as the Syslog
module croaks.
Environment:
Syslog version: 0.29
distribution: Scientific linux 6.2
uname -a : Linux tk145 2.6.32-220.13.1.el6.i686 #1 SMP Tue Apr 17
15:16:12 CDT 2012 i686 i686 i386 GNU/Linux
perl -v:
This is perl 5, version 14, subversion 2 (v5.14.2) built for
i686-linux-thread-multi
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2011, Larry Wall
Binary build 1402 [295342] provided by ActiveState
http://www.ActiveState.com
uname -a:
Thank you very much for your work.
Best regards,
François