[Catalyst] Recommendation For Logging To A File

Brian Kirkbride brian.kirkbride at deeperbydesign.com
Sun Sep 24 22:12:03 CEST 2006


Bill Moseley wrote:
> On Sun, Sep 24, 2006 at 02:32:52PM -0400, hkclark at gmail.com wrote:
>> What is the "recommended best way" (or the 2-3 top contenders if there
>> is no "one best way") to have a Catalyst app log in production to a
>> file (at least I assume that's what most people want their production
>> apps to do).  Is Catalyst::Log::Log4perl the way to go?
> 
> I just find that the normal error logs and grep or perl get me most
> of what I need.
> 
> I have $c->info and $c->error and those are just wrappers for
> $c->log->info and $c->log->error that tack on the IP, current user,
> and a few other bits of common data I find useful when reading th
> logs.  Those go to stderr and apache writes those to the error log
> and is rotated with logrotate.
> 

I used to do the same, but now that I'm running my Cat app under FastCGI 
everything is prefixed in the apache logs with mod_fastcgi: [stderr] blah blah 
which is a serious pain.  Anyone know how to prevent the prefixing?

I'm using (Catalyst::)Log::Log4perl nowadays and it seems fine.  I don't really 
use much more than a single File appender and a formatted layout.  In the future 
it might be nice to filter errors and warnings to different logs/emails.  At 
least I know that I can do that later with a simple log4perl.conf config file 
change.

Best,
Brian Kirkbride



More information about the Catalyst mailing list