This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Where does PropertyConfigurator.configure("log4j.properties"); look for the file...? The CLASSPATH?
Joined: May 04, 2009
Martijn Verburg wrote:Where does PropertyConfigurator.configure("log4j.properties"); look for the file...? The CLASSPATH?
Actually I am not very sure. I read from some docs that PropertyConfigurer will look for for the file in the CLASSPATH.
But I didn't tried to set the properties file in the CLASSPATH. That is one of the two methods, if I am right. I am following the second approach, putting the properties file inside WEB-INF/classes and PropertyConfigurer can find that without any extra code.
Anyway, I am sure that PropertyConfigurator.configure is not looking for the file in the root of the web app.