On Sat, 6 Sep 2014, Bill Moseley wrote:
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
That'd probably be the most straight-forward and cleanest option,
alternatively you can use the L4p API to set up or your config, or even
change the appender in an existing configuration.
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
I'm not quite sure I understand the ApacheLog documentation, as "$r"
typically is the request coming into a mod_perl handler, whereas the
docs indicate it's some kind of server object, which the Apache2 docs
denote as "$s". Best to clarify with the Log::Dispatch::ApacheLog folks.
3) Do I need to use Log::Log4perl::Appender::Synchronized with Apache?
In
I'd write to a separate logfile instead, turning the "syswrite" option
on, which ensures atomic writes without overlap.
I assume setting utf8 is specific to the appender, right?
The "utf8" option is specific to the screen and file appenders, making
sure that Perl toggles the switch so that your utf8 strings get written
out as such.
-- -- Mike
Mike Schilli
m...@perlmeister.com
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
mose...@hank.org
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
log4perl-devel mailing list
log4perl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/log4perl-devel