I have very little application which consists of 2 servlets. I have placed the log4j.properties file in classes folder. I need to know what would be the best practice and how should configure the log4j logger for my application.
Currently i am using this approach
The difference between <b>failure</b> and <b>success</b> is often being <b>right</b> and being <b>exactly right</b>.
Log4j should find it if the configuration file is in the root of the classpath (WEB-INF/classes for a web application). Have a look at the Short Introduction to Log4j and scroll down to the section titled "Default Initialization Procedure" and "Default Initialization under Tomcat".
Joe Ess wrote:Log4j should find it if the configuration file is in the root of the classpath (WEB-INF/classes for a web application). Have a look at the Short Introduction to Log4j and scroll down to the section titled "Default Initialization Procedure" and "Default Initialization under Tomcat".
emm .. that's nice one. Thanks
The difference between <b>failure</b> and <b>success</b> is often being <b>right</b> and being <b>exactly right</b>.