I've hit a snag in my efforts to migrate from Tomcat 5.5.4 to Tomcat 6.0.18. My goal is to have a catalina.out log for stderr, and a webapps.log for my application. Upon startup of Tomcat 6.0.18, only the catalina.out log exists and it contains all output from the webapp.
In Tomcat 5.5.4, log4j, version 1.2.9, looks for log4j.properties in my WEB-INF/classes directory without a problem.
In Tomcat 6.0.18, it appears that log4j, version 1.2.15, is looking for the log4j.properties file in the $CATALINA_HOME/lib folder only.
I've researched this problem on Tomcat's bug database and found a bug with the same problem. However, the two solutions provided, while helpful, don't give a complete answer.
"You should customize the classloader hierarchy to fit your needs, then." "Take a look at TOMCAT_HOME/conf/catalina.properties."
Both of these answers lead me to the catalina.properties file and it's classloading capabilities. This is where I'm stuck. I'm unable to find sufficient documentation on catalina.properties.
If anyone could point me in the right direction, I'd greatly appreciate it.
System: Fedora, Release 9 (Sulphur) Kernel Linux 126.96.36.199-37.fc9.i686
I'm using Tomcat 6 and log4j, with the log4j.properties file in my WEB-INF/classes directory without a problem. As I understand it, log4j looks on the classpath for the log file; and, clearly, the classes directory is part of the generated classpath used by webapps in Tomcat.
Originally posted by Ben Souther: I'm using Tomcat 6 and log4j, with the log4j.properties file in my WEB-INF/classes directory without a problem. As I understand it, log4j looks on the classpath for the log file; and, clearly, the classes directory is part of the generated classpath used by webapps in Tomcat.
Are you sure there isn't some other problem?
It could be another problem, as I'm slowly coming up to speed on Tomcat 6. What I'll do is turn on the debugging and verify that the log file is in the classpath.
I used option -Dlog4j.debug for some help and it turns out my webapp/WEB-INF/classes/log4j.properties file isn't being loaded. Only the $CATALINA_HOME/lib/log4j.properties is loading. I turned on the DEBUG level of the rootLogger and verified that the webapp/WEB-INF/classes is in the classpath.
I'm quickly running out of time and options. I don't have time to acquire and learn a new application server, like Glassfish, but I may be forced to.