[Catalyst] Debug with FCGI

Peter Karman peter at peknet.com
Fri Aug 1 14:57:04 BST 2008



On 08/01/2008 07:55 AM, Angel Kolev wrote:

> Doesn`t work too. All debug output goes to apache log. I tryed with -e
> option - same result.

Look at Catalyst::Log::Log4perl if you want to send debugging output somewhere different
than stderr.

I have this in MyApp.pm just before my setup() call:

unless ( $ENV{LOG4PERL} && $ENV{LOG4PERL} eq 'local' ) {
    require Catalyst::Log::Log4perl;
    __PACKAGE__->log(
        Catalyst::Log::Log4perl->new(
            __PACKAGE__->path_to('log4perl.conf') . ''
        )
    );
}

and then my log4perl.conf file:

log4perl.rootLogger=DEBUG, LOGFILE
log4perl.appender.LOGFILE=Log::Log4perl::Appender::File
log4perl.appender.LOGFILE.filename=/path/to/myapp.debug_log
log4perl.appender.LOGFILE.mode=append
log4perl.appender.LOGFILE.layout=PatternLayout
log4perl.appender.LOGFILE.layout.ConversionPattern=[%r] %F %L %c - %m%n


and finally, I start up my test server like:

 LOG4PERL=local perl script/myapp_server.pl

so that the normal Catalyst log() feature is used.

-- 
Peter Karman  .  peter at peknet.com  .  http://peknet.com/




More information about the Catalyst mailing list