tags:

views:

1032

answers:

1

My tomcat (running in linux/ubuntu) crashes sometimes with a thread dump appended to catalina.out. How do I get this thread dump into a separate log file?

The thread dump is quite large due to the large number of threads running and therefore fills catalina.out making it hard to debug.

+1  A: 

Thread-dump is always written to stdout and Tomcat redirects stdout to catalina.out by default. You can change where it redirects the stdout to but you can't separate thread-dump from other things written to stdout.

Sounds like you have other debug information written to catalina.out. Maybe you can get around this issue by writing all your debug messages to your own log so catalina.out is reserved for thread-dump and a few other things.

See my answer to this question on how to create your own log files,

http://stackoverflow.com/questions/1332691/how-to-configure-logs-catalina-out-of-tomcat-6-for-per-app-configure-web-app-sp

ZZ Coder