You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by ch...@kodak.com on 2001/12/07 19:04:05 UTC

Re-reading configuration settings

From: Chandra Swaminathan

Hi,

I apologize if this question has been asked before, but does anybody know
of an elegant way to re-read configuration information after the
application that uses log4j has been started.  So, if I wanted to start
using a different appender for log4j messages without shutting down the
application and restarting it, is there a way to do this?  My initial
thought was to setup a separate low-priority thread in my application which
would re-initialize the property configurator by reading the property file
every so often. This would catch any changes the next time it reads the
file.  Is this the only way to do it or are there any better approaches?
Thanks in advance for any suggestions.

Chandra.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re-reading configuration settings

Posted by Yoav Shapira <sh...@mpi.com>.
Howdy,
See [DOM|Property]Configurator.configureAndWatch() method.  Good luck,

Yoav

chandra.swaminathan@kodak.com wrote:
> 
> From: Chandra Swaminathan
> 
> Hi,
> 
> I apologize if this question has been asked before, but does anybody know
> of an elegant way to re-read configuration information after the
> application that uses log4j has been started.  So, if I wanted to start
> using a different appender for log4j messages without shutting down the
> application and restarting it, is there a way to do this?  My initial
> thought was to setup a separate low-priority thread in my application which
> would re-initialize the property configurator by reading the property file
> every so often. This would catch any changes the next time it reads the
> file.  Is this the only way to do it or are there any better approaches?
> Thanks in advance for any suggestions.
> 
> Chandra.
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Re-reading configuration settings

Posted by doug b <um...@yahoo.com>.
if you want to automatically do it whenever the file
changes, PropertyConfigurator has a configureAndWatch
method that should do what you want.

--- chandra.swaminathan@kodak.com wrote:
> 
> From: Chandra Swaminathan
> 
> Hi,
> 
> I apologize if this question has been asked before,
> but does anybody know
> of an elegant way to re-read configuration
> information after the
> application that uses log4j has been started.  So,
> if I wanted to start
> using a different appender for log4j messages
> without shutting down the
> application and restarting it, is there a way to do
> this?  My initial
> thought was to setup a separate low-priority thread
> in my application which
> would re-initialize the property configurator by
> reading the property file
> every so often. This would catch any changes the
> next time it reads the
> file.  Is this the only way to do it or are there
> any better approaches?
> Thanks in advance for any suggestions.
> 
> Chandra.
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>