From: Bill M. <mo...@ha...> - 2014-09-06 20:26:50
|
In my log4perl config file I have a very simple screen appender. log4perl.appender.screenAppender = Log::Log4perl::Appender::Screen log4perl.appender.screenAppender.utf8 = 1 log4perl.appender.screenAppender.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.screenAppender.layout.ConversionPattern \ = [%d{E MMM dd HH:mm:ss yyyy}] [%p] ....... Sometimes my Catalyst app runs under mod_perl2 and so I'd like to try using the Log::Dispatch::ApacheLog[1] appender *instead* of the Screen appender. 1) Is there a way in the config to optionally select appenders? Or would it just be better to have more than one log4perl config file and select the file at start (e.g. by specifying which log4perl file to use at startup)? 2) Perhaps a question for another list, but the ApacheLog appender wants a "$r", which the docs say is an Apache or Apache::Server object. Something like this? log4perl.appender.screenAppender = Log::Dispatch::ApacheLog log4perl.appender.screenAppender.apache = sub { Apache2::ServerUtil->server } I assume setting utf8 is specific to the appender, right? 3) Do I need to use Log::Log4perl::Appender::Synchronized with Apache? In my testing with the Screen appender messages < 4K are always written to the logs atomically -- anything larger then I can get mixing of log entries from different processes. Thanks, [1] The reason would be to have a unified format for both app log entires and any messages Apache generates. -- Bill Moseley mo...@ha... |