Configuration of $c->log with Catalyst::Log:...
\ Jochen Luig (8 May 2008)
. \ Marius Kjeldahl (8 May 2008)
. . \ Jochen Luig (8 May 2008)
. \ Marius Kjeldahl (8 May 2008)
. \ Jon Schutz (9 May 2008)
. . \ Jon Schutz (9 May 2008)
. . . \ Jochen Luig (9 May 2008)

8 msgInvalid session ids being generated
4 msgCatalyst / dbix-class / mysql / REST job
2 msgStrange UTF16 warning
1 msgWikipedia article improvement?
5 msgFastCGI: incomplete headers (0 bytes) received ...
5 msgBasic CRUD Tutorial
2 msgHow to display a single HTML::Widget form field...
7 msgLet's port Twitter to Perl
8 msgCatalyst, utf8 in form element type text
17 msgAnybody who fancies some LWP poking ...
54 msgRFC: Catalyst::Controller::REST::DBIC
1 msgKill the book thread please
2 msgMore Catalyst Template Toolkit examples?
6 msgFw: high school reunion (no subject)
2 msg(no subject)
6 msgUsing URIs for my app in another program
4 msgTutorial
11 msg$row->copy causing exit from controller(!)
14 msgHow to print/display some data in an end action
Subject:Configuration of $c->log with Catalyst::Log::Log4perl
Group:Catalyst
From:Jochen Luig
Date:8 May 2008


 
Hi,

I'm trying to replace Catalyst's default logger with
Catalyst::Log::Log4perl.
Here's the relevant part of MyApp.pm:

package MyApp;

use strict;
use warnings;

use Catalyst::Runtime '5.70';

use Catalyst::Log::Log4perl;
use Catalyst qw/
-Debug
ConfigLoader
Static::Simple

StackTrace

Authentication
Authentication::Store::DBIC
Authentication::Credential::Password
Authorization::Roles
Authorization::ACL

Session
Session::Store::FastMmap
Session::State::Cookie

FormValidator
FillInForm
I18N
Unicode

Email

/;

use Sys::Hostname;
our $VERSION = '0.01';


__PACKAGE__->config( name => 'MyApp' );

__PACKAGE__->log( Catalyst::Log::Log4perl->new('myapp_logger.conf'));
__PACKAGE__->setup;

This is myapp_logger.conf:

log4perl.rootLogger=DEBUG, SCREEN

log4perl.appender.SCREEN=Log::Log4perl::Appender::Screen
log4perl.appender.SCREEN.mode=append

log4perl.appender.SCREEN.layout=PatternLayout
log4perl.appender.SCREEN.layout.ConversionPattern=[%d] %C <%p> - %m%n

After starting, the Conversion Pattern the logger actually uses looks like:

%d

Trying to find a minimal App producing the problem, I set up a Test
Application and provided
the same config file. There the logger works as expected.
Next I went through the logger configuration in the debugger with both
Apps up to:

Log::Log4perl::Config::BaseConfigurator::text(/usr/lib/perl5/vendor_perl/5.8.8/L og/Log4perl/Config/BaseConfigurator.pm:29):
29: $self->{text} = $text;

there I dumped $text which contained an array ref containing the lines
of the above cited config file (I saved both dumps to files, and diff
told me they were the same except for the numeric parts of the array
refs). Thus I think I can be quite sure that the logger is initialized
with the same config in both Apps.
Still, my original App comes up with the "%d" ConversionPattern.

So, can anyone tell me where I should continue looking for the error?
Can anyone think of a scenario where the logger config gets messed up
after initial configuration?

Thanks,

Jochen

_______________________________________________
List: Catalyst
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst/
Dev site: http://dev.catalyst.perl.org/


© 2004-2008 readlist.com