Why does tomcat7 log into both catalina.out and catalina.YYYY-MM-DD.log?
After reading some info at http://tomcat.apache.org/tomcat-7.0-doc/logging.html, it seems like commenting out or removing all mentions of java.util.logging.ConsoleHandler
from /etc/tomcat/logging.properties
should do the trick.
After that, somehow the file still gets opened up for writing by tomcat (as stdout
and stderr
), but it doesn't seem to be puffed up with anything anymore.
Cns# stat /var/tomcat/logs/catalina.out
1136 3949577 -rw-r--r-- 1 _tomcat _tomcat 15763648 16695929 "Feb 7 14:58:46 2013" "Feb 7 14:58:37 2013" "Feb 7 14:58:37 2013" 16384 32672 0 /var/tomcat/logs/catalina.out
Cns# fstat | fgrep -e USER -e 3949577
USER CMD PID FD MOUNT INUM MODE R/W SZ|DV
_tomcat java 8994 1 /var 3949577 -rw-r--r-- w 16695929
_tomcat java 8994 2 /var 3949577 -rw-r--r-- w 16695929
Cns#
There are two possible solutions supported by Tomcat wiki:
- Prevent application to log on
System.out
orSystem.err
using logging frameworks. - Suppress capture it by
swallowOutput
. Where does System.out go? First two steps of instruction how to do this.
additionally one remark about rolling it. How do I rotate catalina.out?