On Fri, 8 May 2009, Seth Daniel wrote:

> The reason for this is that I have a number of existing programs that
> use Log4perl for most logging, but some very specific logging does not
> use Log4perl.  I need to be able to use a single signal to tell both
> Log4perl and the other log code to check its configuration and/or
> rewrite the log file for log rotation.

You could use something like

     $SIG{USR2} = sub {
         kill 'USR1', $$;
         # ... now trigger your other logging system ...
     };

     Log::Log4perl->init_and_watch("l4p.conf", 'USR1');

which uses a user-defined signal handler listening to USR2. You can
add whatever other logic you need to it. When triggered, it also forwards
the signal to Log4perl's signal handler, which listens to USR1.

Good enough?

-- Mike

Mike Schilli
m...@perlmeister.com

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
log4perl-devel mailing list
log4perl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/log4perl-devel

Reply via email to