From: Alexander H. <ale...@gm...> - 2014-09-07 09:56:48
|
On Sat, Sep 6, 2014 at 9:56 PM, Bill Moseley <mo...@ha...> wrote: > 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. > Hi Bill, what I do in our Catalyst apps is to have the l4p config inside the Catalyst::Plugin::ConfigLoader config which is selected through an env var. As I have different Catalyst configs for development, testing and production deployment the l4p config inside is different too. BR Alex > > -- > Bill Moseley > mo...@ha... > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel > > |