Use cronolog to separate Tomcat Catalina. Out logs

Source: Internet
Author: User
Use cronolog to split Tomcat's Catalina. Out File

Recently, due to work requirements, the Catalina. Out file of Tomcat is constantly expanding, which leads to a smaller disk space edge and difficult to manage. Therefore, we want to use a tool to separate it. I found cronolog online.

The installation process is as follows:

Download (Latest Version)

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

2. Extract

# Tar zxvf cronolog-1.6.2.tar.gz

3. Go to the directory where the cronolog Installation File is located.

# Cd cronolog-1.6.2

4. Run and install

#./Configure
# Make
# Make install

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

# Which cronolog

Usually:/usr/local/sbin/cronolog

To split Catalina. Out of Tomcat, you need to do the following: 

Modify the Java code in the Catalina. Sh file under the Tomcat bin directory

  1. Org. Apache. Catalina. startup. Bootstrap "$ @" Start \
  2. > "$ Catalina_base"/logs/Catalina. out 2> & 1 &

Is

Java code
  1. Org. Apache. Catalina. startup. Bootstrap "$ @" Start 2> & 1 \
  2. |/Usr/local/sbin/cronolog "$ catalina_base"/logs/Catalina. % Y-% m-% d. Out>/dev/null &

At the same time, there is a line in the file

Java code
  1. Touch "$ catalina_base"/logs/Catalina. Out

You can comment it out and restart tomcat,
Check whether catalina.2009-07-01.out logs exist in the logs 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.