Partition catalina.out files under Linux, generate files by day

Source: Internet
Author: User

1. Download tool Cronolog Compression Pack (http://download.csdn.net/detail/sunling_sz/8144469)


2. Drag and drop files to the server, any directory can be.


3. Enter the installation directory to Cronolog

# CD cronolog-1.6.2

4. Run the installation

#./configure
# make
# make Install

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

# which Cronolog

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

To split Tomcat's catalina.out, you need to do the following:
Modify the catalina.sh file in the Tomcat bin directory.
1, will
If [-Z "$CATALINA _out"]; Then
catalina_out= "$CATALINA _base"/logs/catalina.out
Fi
Revision changed to
If [-Z "$CATALINA _out"]; Then
catalina_out= "$CATALINA _base"/logs/catalina.out.%y-%m-%d
Fi


2. Comment out touch "$CATALINA _base"/logs/catalina.out


3, will

Org.apache.catalina.startup.Bootstrap "[email protected]" start \
>> "$CATALINA _base"/logs/catalina.out 2>&1 &
Revision changed to
Org.apache.catalina.startup.Bootstrap "[email protected]" Start 2>&1 \
| /usr/local/sbin/cronolog "$CATALINA _out" >>/dev/null &

Save and restart Tomcat.

Partition catalina.out files under Linux, generate files by day

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.