Originally posted by Jignesh Patel:
As a property file of log4j I have tried to use .xml file. But PropertyConfigurator couldn't able to read it on the contrarary .properties file worked fine.
You actually want to use DOMConfigurator when using an XML file for configuring log4j. PropertyConfigurator is only for reading properties files.
DOMConfigurator.configureAndWatch() is a handy method, because you can set an interval to re-check the configuration file, meaning if you want to change log levels, you won't have to restart your container.