Friday, August 19, 2005

Debugging Log4j XML Errors

If you've validated your log4j.xml with its DTD (log4j.dtd) and there're still errors spewing out at the console of your application server, you can turn on debugging info using -Dlog4j at command line startup. In Tomcat just specify the following at the beginning of the catalina.bat file (in Windows):

set JAVA_OPTS=-Dlog4j.debug

At startup the console will be full of debugging output. It will show which log4j.xml file is read.

I found the culprit file which was residing in a JAR file I changed the file and updated the JAR file to make the errors go away.

No comments: