Bug 33502 - DOMConfigurator.configureAndWatch does not perform an initial config
Summary: DOMConfigurator.configureAndWatch does not perform an initial config
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Configurator (show other bugs)
Version: 1.2
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
Depends on:
Reported: 2005-02-10 21:33 UTC by John Cahill
Modified: 2007-08-22 16:01 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
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.



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.