From: Martin J. E. <mar...@ea...> - 2006-02-08 14:39:28
|
Hi, I've been using log4perl for around a month in a new project - suits me great - thanks for that. When one of my modules failed I noticed a perculiar message on stderr and have reduced the problem to this: perl -MData::Dumper -e 'use Log::Log4perl qw(get_logger :levels);Log::Log4perl->init_and_watch("/etc/log4.conf", 10);my $log = get_logger("XMLLoad::Log"); $log->logwarn(sub {Dumper([qw(a b c)])});' When I run the above with the config below I get: CODE(0x8132f00) at -e line 1 and yet the log file contains: 2006/02/08 14:30:01 WARN> $VAR1 = [ 'a', 'b', 'c' ]; Why wasn't the output in the log file duplicated on stderr? I seem to be getting the code reference to the sub instead of the result of the sub. BTW, same happens with logdie. My config file is: log4perl.logger.XMLLoad.Log = DEBUG, A7 log4perl.appender.A7=Log::Dispatch::File log4perl.appender.A7.filename=/tmp/xml_load.log log4perl.appender.A7.mode=append log4perl.appender.A7.layout=Log::Log4perl::Layout::PatternLayout log4perl.appender.A7.layout.ConversionPattern=%d %p> %m%n BTW, I did notice this mailing list was for patches, enhancements and bug reports but I could not find any other log4perl lists and the sourceforge forums seemed to be almost dead with the last post being 1-dec-05 (and unanswered). Thanks. Martin -- Martin J. Evans Easysoft Ltd, UK http://www.easysoft.com |