|
From: Mike S. <m...@pe...> - 2005-09-09 07:52:45
|
On Fri, 9 Sep 2005, Chris Anderson wrote:
> In an application where I have multiple children each needing to log to
> their own file, I've noticed using the get_logger() or init to changes
> the configuration for all the children and the parent as well. So
> effectively, when multiple processes use the same instance through
> get_logger() they all just combine in the same file. I didn't see
> anything in the documentation regarding how to handle this, so I was
> hoping someone may be able to shed some light on what I need to do to
> segregate these logging rules.
It depends on where you call Log::Log4perl->init().
If it's called in each child process, then the filename can be specified
dynamically (using something like the pid):
http://log4perl.sourceforge.net/d/Log/Log4perl/FAQ.html#02bbc
If Log::Log4perl->init() gets called in the main process, messages
need to be filtered dynamically, using a custom filter:
http://log4perl.sourceforge.net/d/Log/Log4perl/FAQ.html#c7fa8
http://log4perl.sourceforge.net/d/Log/Log4perl/Filter.html
Let me know if you need more detailed info.
-- Mike
Mike Schilli
m...@pe...
|