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