Skip Menu |

This queue is for tickets about the Log-Log4perl CPAN distribution.

Report information
The Basics
Id: 28679
Status: resolved
Priority: 0/
Queue: Log-Log4perl

People
Owner: Nobody in particular
Requestors: lloy0076 [...] adam.com.au
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.12
Fixed in: (no value)



Subject: Threshold Configuration Bug
This line at around Line 440 of Log::Log4perl::Config.pm: if($data->{appender}->{$appname}->{threshold}) { die "threshold keyword needs to be uppercase"; } ...states that the threshold keyword needs to be uppdercase. However that predicate fires WHENEVER the threshold keyword contains ANYTHING at all. There are a number of solutions: 1. Change it so that it does what the die says 2. Eradicate the die (and STDERR it or ignore it altogether) My solution has been to eradicate the die totally. This happens when you have a configuration like this: log4perl.logger=DEBUG, FILE # Notice how this threshold _is_ uppercase log4perl.apender.FILE.threshold=INFO log4perl.appender.FILE=Log::Log4perl::Appender::File Log4perl.appender.FILE.filename=/tmp/my.log log4perl.appender.FILE.mode=write Or even this: log4perl.logger=DEBUG, FILE # Notice how this threshold is _not_ uppercase log4perl.apender.FILE.threshold=info log4perl.appender.FILE=Log::Log4perl::Appender::File Log4perl.appender.FILE.filename=/tmp/my.log log4perl.appender.FILE.mode=write ... Once you get rid of this issue, the threshold keyword works as expected; that is to say it appears to be a CONFIG only issue. I'm using: This is perl, v5.8.8 built for i86pc-solaris-thread-multi $Log::Log4perl::VERSION = 0.52 I've noticed this on: FreeBSD 5.x Ubuntu GNU/Linux latest By using "source" link on search.cpan.org ...for the latest version. Thanks, DSL
From: lloy0076 [...] adam.com.au
Errr... Currently both these configurations will die: Show quoted text
> This happens when you have a configuration like this: > log4perl.logger=DEBUG, FILE > # Notice how this threshold _is_ uppercase > log4perl.apender.FILE.threshold=INFO > log4perl.appender.FILE=Log::Log4perl::Appender::File > Log4perl.appender.FILE.filename=/tmp/my.log > log4perl.appender.FILE.mode=write > > Or even this: > > log4perl.logger=DEBUG, FILE > # Notice how this threshold is _not_ uppercase > log4perl.apender.FILE.threshold=info > log4perl.appender.FILE=Log::Log4perl::Appender::File > Log4perl.appender.FILE.filename=/tmp/my.log > log4perl.appender.FILE.mode=write
DSL
You've probably figured it out by now, but just in case: The "uppercase" refers to the keyword ("Threshold"), not to its value ("info/INFO"). It needs to be log4perl.appender.BUF0.Threshold = ERROR and not # wrong! log4perl.appender.BUF0.threshold = ERROR to avoid confusion with appender settings, which are lower case. Somewhat unrelated, the test in Config.pm was slightly wrong, I've fixed it for 1.26 by adding an exists() (the way it was you could have worked around it by setting it to a false value :). http://github.com/mschilli/log4perl/commit/508d5843eff5e57db96449c93667ef932a330445