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.

D. Wroblewski
  • 7,530
  • 4
  • 27
  • 30
  • Isn't this the kind of information that is supposed to go in catalina.out? You can always put ordinary logging in separate files. – Buhb Sep 08 '09 at 08:20

1 Answers1

2

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,

How to configure logs/catalina.out of tomcat 6 for per-app. (Configure web-app specific log file for sys.out, sys.err)

Community
  • 1
  • 1
ZZ Coder
  • 74,484
  • 29
  • 137
  • 169