I think you should do that in your own application initialization code.   
You can define  this "watchConfiguration" property and use it to control
which log4j configure method is used. 

Something like: 
/***************************************************************************
*****************/ 
String configFlag = System.getProperty("watchConfiguration"); 
String configFile = System.getProperty("configFile"); 
if ( configFlag.equalsIgnoreCase("true") { 
  PropertyConfigurator.configure(configFile); 
} 
else { 
  PropertyConfigurator.configure.configureAndWatch(configFile, 5000); 
} 
/***************************************************************************
*****************/ 


Jin 

On Thursday, May 16, 2002, at 01:01  PM, Liu, Mike wrote: 


> Thanks for that.  But actually what I mean is to see if there is any way 
> to 
> specify the auto-reloading via system property, for example, 
> -Dlog4j.watchConfiguration=true/false.  Anyone knows about this? 
> 
> Thanks, 
> Mike Liu 
> 
> 
> 
> -----Original Message----- 
> From: Collier, Mike [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, May 16, 2002 9:56 AM 
> To: 'Log4J Users List' 
> Subject: RE: reloading properties file 
> 
> 
> Take a look at the configureAndWatch method on PropertyConfigurator 
> and/or 
> DOMConfigurator. 
> 
> -----Original Message----- 
> From: Liu, Mike [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, May 16, 2002 12:55 PM 
> To: 'Log4J Users List' 
> Subject: reloading properties file 
> 
> 
> Hi, 
> 
> Can someone point me the right direction about setting up log4j to 
> auto-reload log4j.properties file?  I can't seem to get the 
> log4j.properties 
> reloaded automatically during runtime. 
> 
> 
> thanks, 
> Mike Liu 
> 
> -- 
> To unsubscribe, e-mail: 
> <mailto:[EMAIL PROTECTED]> 
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]> 
> 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to