with the operation of Tomcat, Catalina.out files will grow larger, although Tomcat will generate a Catalina.ymd.log file every day, but Catalina.out main file is still increasing, need to catalina.out by the day, to find a bit on the Internet, see an article The rotating catalina.out in Tomcat 5.5 using Cronolog is configured with the company's Tomcat.
The Cronolog tool has been installed on the server, a small tool for log slicing, and its home page in http://cronolog.org/, which we also use to slice Apache logs.
go into the Tomcat Bin directory, open the catalina.sh file, find the related lines of Tomcat startup, or you can find catalina.out directly, and generally we modify the contents of the following line (because we don't normally run under-security conditions),
Else
"$_runjava" $JAVA _opts $CATALINA _opts \
-djava.endorsed.dirs= "$JAVA _endorsed_dirs"-classpath "$CLASSPATH" \
-dcatalina.base= "$CATALINA _base" \
-dcatalina.home= "$CATALINA _home" \
-djava.io.tmpdir= "$CATALINA _tmpdir" \
Org.apache.catalina.startup.Bootstrap "[email protected]" start \
>> "$CATALINA _base"/logs/catalina.out 2>&1 &
if [!-Z "$CATALINA _pid"]; Then
Echo $! > $CATALINA _pid
Fi
Fi
Modify
org.apache.catalina.startup.Bootstrap "[email protected]" start \
>> "$CATALINA _base"/logs/catalina.out 2>&1 &
to be
org.apache.catalina.startup.Bootstrap "[email protected]" Start 2>&1 \
|/usr/local/sbin/cronolog "$CATALINA _base"/logs/catalina.%y-%m-%d.out >>/dev/null &
at the same time, there is a row
Touch "$CATALINA _base"/logs/catalina.out
can be commented out, after the completion of the restart Tomcat can be, in the logs directory can see the Catalina.2009-02-18.out log, is generated by the day.
Linux shard Tomcat catalina.out log file