Subject: | $logger->log function not working |
my $trans = Log::Log4perl->get_logger('wsl.trans');
when using the function $trans->info everything works like it should
when using the $trans->log( .... ) it croaks in Log4perl main section
with the error:
priority level isn't numeric at scribe_perl_logger.pl line 9
Sample script attached below.
Debugged:
main::(scribe_perl_logger.pl:5):
Log::Log4perl::init_and_watch('/tmp/log4perl.conf',10);
DB<1> n
main::(scribe_perl_logger.pl:6): my $trans = Log::Log4perl-
Show quoted text
>get_logger('wsl.trans');
DB<1> n
main::(scribe_perl_logger.pl:8): $trans->info("works");
DB<1> n
main::(scribe_perl_logger.pl:9): $trans->log(level => "info", message
=> "does not work");
DB<1> s
Log::Log4perl::Logger::log(/usr/lib/perl5/site_perl/5.8.8/Log/Log4perl/L
ogger.pm:670):
670: my ($self, $priority, @messages) = @_;
DB<3> n
Log::Log4perl::Logger::log(/usr/lib/perl5/site_perl/5.8.8/Log/Log4perl/L
ogger.pm:672):
672: confess("log: No priority given!") unless
defined($priority);
DB<3> x $priority
0 'level'
DB<4> x @messages
0 'info'
1 'message'
2 'does not work'
--START----------------------
#!/usr/bin/perl
use Log::Log4perl;
Log::Log4perl::init_and_watch('/tmp/log4perl.conf',10);
my $trans = Log::Log4perl->get_logger('wsl.trans');
$trans->info("works");
$trans->log(level => "info", message => "does not work");
---END-------------------
--START-CONF----------------------------
[jwieland@tsc-dev ~]$ cat /tmp/log4perl.conf
log4perl.logger.wsl.trans=INFO, SCRIBE
log4perl.appender.SCRIBE=Log::Dispatch::Scribe
log4perl.appender.SCRIBE.host=localhost
log4perl.appender.SCRIBE.port=1463
log4perl.appender.SCRIBE.category=system
log4perl.appender.SCRIBE.retry_plan_a=buffer
log4perl.appender.SCRIBE.retry_buffer_size=5000
log4perl.appender.SCRIBE.retry_plan_b=discard
log4perl.appender.SCRIBE.layout=PatternLayout
log4perl.appender.SCRIBE.layout.ConversionPattern="%m"
--END---------------------------------------
Also a couple spelling mistakes in the documentation:
* its says Version 0.01 but the module in on 0.02
* In both log functions it has 'messsage' (spelt wrong) ie. messsage =>
'something BAD happened'
Also emailing the bug into bug-log-logdispatch-scribe@rt.cpan.org fails
with the error message
--START------------------------------------
This is the mail system at host diesel.bestpractical.com.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system
<cpan-bug+log-logdispatch-scribe@diesel.bestpractical.com> (expanded
from
<bug-log-logdispatch-scribe@rt.cpan.org>): temporary failure.
Command
output: bayes: cannot write to
/opt/filter//.spamassassin/bayes_journal,
bayes db update ignored: Permission denied RT server error. The RT
server
which handled your email did not behave as expected. It said:
temporary
failure - RT couldn't find the queue: log-logdispatch-scribe
Reporting-MTA: dns; diesel.bestpractical.com
X-Postfix-Queue-ID: 3814C4D801C
X-Postfix-Sender: rfc822; jwieland@gmail.com
Arrival-Date: Wed, 20 Jan 2010 19:37:48 -0500 (EST)
Final-Recipient: rfc822; cpan-bug+log-logdispatch-
scribe@diesel.bestpractical.com
Original-Recipient: rfc822;bug-log-logdispatch-scribe@rt.cpan.org
Action: failed
Status: 4.3.0
Diagnostic-Code: x-unix; bayes: cannot write to
/opt/filter//.spamassassin/bayes_journal, bayes db update ignored:
Permission denied RT server error. The RT server which handled your
email
did not behave as expected. It said: temporary failure - RT
couldn't find
the queue: log-logdispatch-scribe
--END------------------------------------------------------
Thanks for your time, Jason