I'm forced to use custom closed source lib in my web app deployed in tomcat 6. It is logging a lot of exceptions in my stdout log (catalina.out) via printStackTrace and then rethrowing them for me to handle. Is there a way to prevent or reroute logging of exceptions from a specific package deployed in webapp?
2 Answers
2
votes
e.printStackTrace
prints to the console similar to System.err
In Tomcat, the catalina.sh
has this line which redirects all console errors to catalina.out
This applies for the Tomcat server as a whole.
"$CATALINA_BASE"/logs/catalina.out 2>&1 &
So in short, if you cant tinker with the source code to use log4j, you could try sending this to another file within the catalina.sh, but again this would not be package specific as you want.
And this would just bloat another file in a similar manner.