Skip Menu |

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

Report information
The Basics
Id: 54018
Status: resolved
Priority: 0/
Queue: Log-Dispatch-Scribe

People
Owner: Nobody in particular
Requestors: jwieland [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.02
Fixed in: (no value)



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
Hi Jason, Sorry for not dealing with this earlier; the bug report did not get through to my email for reasons unknown. The log() function you're invoking belongs to the upper layer (Log::Log4perl in your case, otherwise Log::Dispatch) - it's not the Log::Dispatch::Scribe version of log(). When using Log::Log4perl, the syntax for the log function is $log->log($INFO, "..."); The other form, $log->log(level => 'emergency', message => '...'), only works with Log::Dispatch. I have updated the documentation to clarify this. Thankyou for the other doc errors you identified; I have fixed the docs and the typo in the bug queue name. -- Jon Schutz On Tue Jan 26 19:03:27 2010, https://www.google.com/accounts/o8/id?id=AItOawn8qwQHsO3cd7oJPbNamKBQ5ydyKQkLEhs wrote: Show quoted text
> 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-
> >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