[log4perl-devel] Looking for function to explicitly reload config file

2007-08-29 Thread Joachim Schrod
Hi,

Great piece of work, your Log::Log4perl module. Especially in mixed 
Java/Perl environments, it makes log management a breeze. :-)

But now I stumbled over something that I could not locate in the 
documentation or the FAQ. (Looking at the source of 
init_and_watch() didn't help either. :-() I'd like to use a 
function or method from Log::Log4perl to explicitly reload the 
log4perl config file. How do I do that? Do I call init() again?

If calling init() is the right solution, does this change the 
existing singleton object or does this allocate a new one? I.e., 
can I continue to use previously attained logger objects or do I 
need to call get_logger() anew?

This is for a daemon that receives commands to reconfigure itself 
on a TCP command channel. I don't want to use init_and_watch() for 
performance reasons, and reload-by-signal is a no-no as well. (All 
signals are handled by the daemon, a subsidiary module like 
Log::Log4perl must not install an own signal handler.)

Any tips or hints would be appreciated.

Best,
Joachim

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Joachim Schrod  Email: [EMAIL PROTECTED]
Roedermark, Germany


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
___
log4perl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel


Re: [log4perl-devel] Looking for function to explicitly reload config file

2007-08-29 Thread Kevin M. Goess
Joachim,

> Great piece of work, your Log::Log4perl module. Especially in mixed
> Java/Perl environments, it makes log management a breeze. :-)

Thanks!

> I'd like to use a
> function or method from Log::Log4perl to explicitly reload the
> log4perl config file. How do I do that? Do I call init() again?

Yeah, go ahead and call Log::Log4Perl->init all day.  You'll get the
same functionality that init_and_watch does when it reloads a changed
config.

> can I continue to use previously attained logger objects or do I
> need to call get_logger() anew?

Yes, all your $logger objects are still good (assuming you haven't
un-supported them in your new config).  The existing singleton objects
stay the same, but the coderefs they contain have been updated with the
new behavior.




-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
___
log4perl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel