I'm running tomcat 6.0.20 (with spring, if that matters) and can't seem to get stack traces from uncaught exceptions thrown from within my code to print to catalina.out.
I'm trying to mimic the output that you see in the eclipse console. When I deploy a war on a production server and start tomcat, most of the output goes to catalina.out, but stack traces from exceptions thrown within my own code goes to tomcat/logs/localhost.[date].log.
How can I get all of the relevant logging to go to one file (similar to eclipse's console)?
I'm starting the server by simply running tomcat/bin/startup.sh
Catalina. out contains almost everything in the log including something more. It might be useful to post the config files, the tomcat version of the log4j in conf and also your applications config of log4j usually in root of your webapp's classpath.
By default, the catalina. out file is located in the logs directory under Tomcat's root directory. For example, /opt/netiq/idm/apps/tomcat/logs/catalina.
Catalina. out simply contains everything that is written to Tomcat's "System. out" and "System.
Edit TOMCAT_HOME/conf/logging.properties
The default would have the catalina engine log to catalina.log and the localhost logging to localhost.log
like below
1catalina.org.apache.juli.FileHandler.level = ALL
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.
2localhost.org.apache.juli.FileHandler.level = ALL
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.
Take your pick and edit .prefix
to point to the one you want.
Update
catalina.out
is explicitly referenced as shown below in the catalina.sh
start script (but not in the corresponsing bat files) - which is why I dont see the .out file on windows but only on *nix systems
"$CATALINA_BASE"/logs/catalina.out 2>&1
Personally I prefer the Catalina engine logs being separate from my application logs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With