Bug 33502

Summary: DOMConfigurator.configureAndWatch does not perform an initial config
Product: Log4j - Now in Jira Reporter: John Cahill <john_cahill>
Component: ConfiguratorAssignee: log4j-dev <log4j-dev>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: P2    
Version: 1.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description John Cahill 2005-02-10 21:33:37 UTC
The DOMConfigurator function configureAndWatch (line 556) (in log4j 1.2.9) 
only watches a configuration file, and does not perform configuration using 
the indicated file.

Workaround: currently using,
DOMConfigurator.doConfigure(InputStream, LoggerRepository) and then watching 
the config file using a separate api call.
Comment 1 John Cahill 2005-02-10 21:38:00 UTC
The DOMConfigurator delegates configuration to XMLWatchdog, which will only 
perform the first configuration upon detecting a file change.

XMLWatchdog.doOnChange()

calls

DOMConfigurator.doConfigure(String,LoggerRepository);  
Comment 2 John Cahill 2005-02-10 21:52:09 UTC
Also: In the base class of XMLWatchdog, FileWatchdog does attempt to perform a 
first configuration of the indicated file (via checkAndConfigure()), but in my 
tests, this first configuration fails because FileWatchdog seems not to be 
able to deal with resources that exist on the classpath (via fileExists, line 
68, since FileWatchdog is depending on a java.io.File reference).

At any rate, DOMConfigurator.configureAndWatch() does not perform an initial 
config, and possibly not even a watch
Comment 3 Curt Arnold 2005-07-31 01:39:40 UTC
Changed bug summary.
Comment 4 Curt Arnold 2007-08-22 16:01:24 UTC
Added unit test in rev 568763.  DOMConfigurator.configureAndWatch does appear to perform an initial 
configuration.  Perhaps fixed sometime in the interim.