On Sat, May 09, 2009 at 12:12:28AM -0700, Mike Schilli wrote:
> 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?
I was hoping for a solution that didn't burn two signals. I'm already
using the most obvious signals: HUP, USR1, USR2, KILL, QUIT, etc... so
I'm not exactly overflowing with extra signals. :o)
--
seth /\ sethdaniel.org
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel