From: <msc...@ao...> - 2003-02-27 08:24:30
Attachments:
diff
|
In a message dated 2/26/2003 7:24:28 PM Eastern Standard Time, Kevin Goess <ke...@go...> writes: >Sagar, it looks like log4perl is taking the values from your config hash >and converting them into text strings: Aha! Thanks for the great detective work! >but there is another problem in Log4perl. Log::Dispatch expects the >'level' param to be a word, we are passing an integer, which suggests >that the hash %Log::Log4perl::Levels::L4P_TO_LD should have values that >are words not integers, and that this stuff in Levels.pm Hmm. The Log::Dispatch man page seems to say integers are okay: "Alternately, the numbers 0 through 7 may be used (debug is 0 and emergency is 7)." Is the Apache logger different? If yes, we can certainly add the change as you suggested, patch is attached. -- -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |
From: <Sag...@ub...> - 2003-02-27 13:39:16
|
Kevin/Mike, Thanks very much for your help, at least I now know I wasn't doing = anything silly. I look forward to these fixes in a future Log4perl release. In the = meantime I'm going to implement my own subclass of = Log::Dispatch::ApacheLog with a) hard code the numbers temporarily (unfortunately I can't just patch = the Log4perl, large organisations like mine have lots of rules) b) replace the need for the $r apache argument. I really don't see why Log::Dispatch::ApacheLog requires the user to = pass it an Apache::Request or Apache::Server object since it could = simply do: use Apache; use Apache::Log; if($r and not $r->isa('Apache::Server') and not $r->('Apache::Request')) = { $r =3D Apache->request->server; } I guess one for me to ponder for a bit longer/ push to the Log::Dispatch = author/team. Thanks again for your help and for producing log4perl in the first = place! Best Regards Sagar >-----Original Message----- >From: msc...@ao... [mailto:msc...@ao...] >Sent: 27 February 2003 08:24 >To: ke...@go...; Shah, Sagar >Cc: log...@li... >Subject: Re: [log4perl-devel] Log4perl / Log::Dispatch::ApacheLog >problem > > >In a message dated 2/26/2003 7:24:28 PM Eastern Standard Time,=20 >Kevin Goess <ke...@go...> writes: > >>Sagar, it looks like log4perl is taking the values from your=20 >config hash=20 >>and converting them into text strings: > >Aha! Thanks for the great detective work!=20 > >>but there is another problem in Log4perl. Log::Dispatch expects the=20 >>'level' param to be a word, we are passing an integer, which suggests=20 >>that the hash %Log::Log4perl::Levels::L4P_TO_LD should have=20 >values that=20 >>are words not integers, and that this stuff in Levels.pm > >Hmm. The Log::Dispatch man page seems to say integers are okay: > > "Alternately, the numbers 0 through 7 may be used (debug is=20 >0 and emergency is 7)." > >Is the Apache logger different? If yes, we can certainly add=20 >the change as you suggested, patch is attached.=20 > >--=20 >-- Mike > >############################ ># Mike Schilli # ># log...@pe... # ># http://perlmeister.com # ># log4perl.sourceforge.net # >############################ > +ANYTHING+BELOW+THIS+LINE+WAS+ADDED+AFTER+I+HIT+SEND+ Visit our website at http://www.ubswarburg.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. |
From: Kevin G. <ke...@go...> - 2003-02-27 16:16:54
|
msc...@ao... wrote: > In a message dated 2/26/2003 7:24:28 PM Eastern Standard Time, Kevin > Goess <ke...@go...> writes: > >> but there is another problem in Log4perl. Log::Dispatch expects >> the 'level' param to be a word, we are passing an integer, which >> suggests that the hash %Log::Log4perl::Levels::L4P_TO_LD should >> have values that are words not integers, and that this stuff in >> Levels.pm > > > Hmm. The Log::Dispatch man page seems to say integers are okay: > > "Alternately, the numbers 0 through 7 may be used (debug is 0 and > emergency is 7)." > > Is the Apache logger different? If yes, we can certainly add the > change as you suggested, patch is attached. Well, you're right, the Log::Dispatch docs do say that. But the guts of ApacheLog.pm are doing stuff like this elsif( $p{level} eq 'warning' ) { $method = 'warn'; } else { $method = $p{level}; } $self->{apache_log}->$method( $p{message} ); which is where it fails trying to call $log->7() if you pass it a number. Mike, are there any negative ramifications to changing it from a number to a string? Is there anything else that expects it to be a number? Dave, is this a deficiency in ApacheLog.pm, or are we misunderstanding something? -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |
From: Dave R. <au...@ur...> - 2003-02-27 18:21:07
|
On Thu, 27 Feb 2003, Kevin Goess wrote: > Dave, is this a deficiency in ApacheLog.pm, or are we misunderstanding > something? It's a bug for sure. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |
From: Mike S. <msc...@ao...> - 2003-02-27 18:30:55
|
ke...@go... wrote: > Mike, are there any negative ramifications to changing it from a > number to a string? Is there anything else that expects it to be a > number? > Should be fine, the test suite passes and I'm not aware of any appenders insisting on the numbers. But, ideally, I'd like Log::Dispatch::ApacheLog to adhere to the Log::Dispatch spec (or, alternatively, the Log::Dispatch spec needs to be updated). -- -- Mike Mike Schilli log...@pe... |
From: Dave R. <au...@ur...> - 2003-02-27 18:40:50
|
On Thu, 27 Feb 2003, Mike Schilli wrote: > Should be fine, the test suite passes and I'm not aware of any appenders > insisting on the numbers. But, ideally, I'd like > Log::Dispatch::ApacheLog to adhere to the Log::Dispatch spec (or, > alternatively, the Log::Dispatch spec needs to be updated). Like I said, it's a bug in Log::Dispatch::ApacheLog. I should fix it ;) -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ |