TOMCAT7 catalina.out Log Segmentation

Source: Internet
Author: User

Recently found that the Tomcat log file catalina.out is constantly getting bigger, my server that file is now close to 10G, resulting in a smaller system disk space, and management is difficult to manage, so want to use a tool to split it. Look for the internet to find with Cronolog.


The installation process is as follows

1. Download (attachments can be downloaded)

# wget http://cronolog.org/download/cronolog-1.6.2.tar.gz

2. Decompression

# tar ZXVF cronolog-1.6.2.tar.gz

3. Enter the directory where the Cronolog installation files are located

# CD cronolog-1.6.2

4. Run the installation

#./configure
# make
# make Install

5. Check the directory where the Cronolog is installed (verify the installation is successful)

# which Cronolog

Typically shown as:/usr/local/sbin/cronolog


To divide Tomcat7 Catalina.out, the following work is required:

Go to Tomcat's Bin directory and modify the catalina.sh file as follows:


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/8C/68/wKiom1hrYGOQonJYAADXh0Zjoag536.jpg "title=" 1483431974 (1). jpg "alt=" wkiom1hrygoqonjyaadxh0zjoag536.jpg "/>


There are two places that need to be modified:

1. Line No. 379, modify the result: # touch "$CATALINA _out"

2. Line No. 401, the result of the modification is: org.apache.catalina.startup.Bootstrap "[email protected]" Start 2>&1 |/usr/local/sbin/ Cronolog "$CATALINA _base"/logs/catalina.%y-%m-%d.out >>/dev/null &

3. Restart Tomcat to generate a format such as Catalina.2013-05-20.out









This article from "Rookie also want to fly" blog, please be sure to keep this source http://xiumin.blog.51cto.com/6205237/1888640

TOMCAT7 catalina.out Log Segmentation

Related Article

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.