From: Mike S. <m...@pe...> - 2009-05-09 07:35:35
|
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...@pe... |