On OpenBSD 5.2, the default installation of tomcat-7.0.29 seems to be logging all errors into both catalina.out
and catalina.YYYY-MM-DD.log
.
Cns# ll /var/tomcat/logs/catalina.*
-rw-r--r-- 1 _tomcat _tomcat 3067 Jan 16 20:47 /var/tomcat/logs/catalina.2013-01-16.log
-rw-r--r-- 1 _tomcat _tomcat 1313285 Jan 17 21:47 /var/tomcat/logs/catalina.2013-01-17.log
-rw-r--r-- 1 _tomcat _tomcat 19668 Jan 18 17:33 /var/tomcat/logs/catalina.2013-01-18.log
-rw-r--r-- 1 _tomcat _tomcat 2479 Jan 23 15:25 /var/tomcat/logs/catalina.2013-01-23.log
-rw-r--r-- 1 _tomcat _tomcat 1580 Jan 26 22:58 /var/tomcat/logs/catalina.2013-01-26.log
-rw-r--r-- 1 _tomcat _tomcat 48165 Jan 27 19:30 /var/tomcat/logs/catalina.2013-01-27.log
-rw-r--r-- 1 _tomcat _tomcat 34526 Jan 28 16:41 /var/tomcat/logs/catalina.2013-01-28.log
-rw-r--r-- 1 _tomcat _tomcat 141985 Jan 29 23:56 /var/tomcat/logs/catalina.2013-01-29.log
-rw-r--r-- 1 _tomcat _tomcat 123254 Jan 30 23:25 /var/tomcat/logs/catalina.2013-01-30.log
-rw-r--r-- 1 _tomcat _tomcat 145209 Jan 31 22:30 /var/tomcat/logs/catalina.2013-01-31.log
-rw-r--r-- 1 _tomcat _tomcat 2615 Feb 1 09:01 /var/tomcat/logs/catalina.2013-02-01.log
-rw-r--r-- 1 _tomcat _tomcat 10068 Feb 2 19:18 /var/tomcat/logs/catalina.2013-02-02.log
-rw-r--r-- 1 _tomcat _tomcat 50541 Feb 3 23:49 /var/tomcat/logs/catalina.2013-02-03.log
-rw-r--r-- 1 _tomcat _tomcat 17519 Feb 4 21:29 /var/tomcat/logs/catalina.2013-02-04.log
-rw-r--r-- 1 _tomcat _tomcat 1158 Feb 5 22:18 /var/tomcat/logs/catalina.2013-02-05.log
-rw-r--r-- 1 _tomcat _tomcat 179466 Feb 6 23:51 /var/tomcat/logs/catalina.2013-02-06.log
-rw-r--r-- 1 _tomcat _tomcat 14585534 Feb 7 14:15 /var/tomcat/logs/catalina.2013-02-07.log
-rw-r--r-- 1 _tomcat _tomcat 16680119 Feb 7 14:15 /var/tomcat/logs/catalina.out
(Note how the total files size of catalina.YYYY-MM-DD.log
is about the same as catalina.out
, and the logs do seem duplicated.)
Is there a way to make it log only into catalina.YYYY-MM-DD.log
, and not into catalina.out
?
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
andstderr
), but it doesn't seem to be puffed up with anything anymore.There are two possible solutions supported by Tomcat wiki:
System.out
orSystem.err
using logging frameworks.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?