|
From: Brett R. <bre...@ma...> - 2003-09-22 23:22:09
|
USING:
Log4perl 0.37
Perl 5.00503
PROBLEM:
When using a pattern layout with %l, calls to error_die report the error_die line details instead of the calling line details:
EXAMPLE:
# file and format for detailed log
log4perl.appender.fileDetailed = Log::Log4perl::Appender::File
log4perl.appender.fileDetailed.filename = test2_error.log
log4perl.appender.fileDetailed.mode = append
log4perl.appender.fileDetailed.layout = PatternLayout
log4perl.appender.fileDetailed.layout.ConversionPattern\
= >>%-8p %d logger(%c)%n %m%n at %l%n
log4perl.appender.fileDetailed.Filter = includeDebugErrorFatal
code:
eval { bar() };
# check if the eval had a failed response.
if ($@) {
$logger->error_die("bar() died during evaluate:$@");
}
exit 0 ;
sub bar {
$logger->logdie('bar() is not implemented');
}
log file:
>>FATAL 2003/09/23 08:52:52 logger(main)
bar() is not implemented
at main::bar test2.pl (33)
>>ERROR 2003/09/23 08:52:52 logger(main)
bar() died during evaluate:bar() is not implemented at test2.pl line 33
at Log::Log4perl::Logger::error_die /web/home/brann/perllib/Log/Log4perl/Logger.pm (822)
I would expect line in ERROR to be reported in a similar way to the line in FATAL.
(sorry, enbedded bug report / feature request here)
Also, the path seems inconsistant. Error die reports the full path, log die reports just the filename (this is also true for %F). Also, with the DBI appender it reports the full path for all log types, but file apender reports just the filename. It would be nice for it to be standardized. Perhaps %f for the short filename, and %F for the full?
No patching this time. I just avoid the issue. ;)
Happy to provide more detail if you can't reproduce the error.
Brett
--
--
__________________________________________________________
Sign-up for your own personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers
|