Linux shard Tomcat catalina.out log file

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.