[Tomcat] Tomcat log cutting and tomcat log Cutting

Source: Internet
Author: User

[Tomcat] Tomcat log cutting and tomcat log Cutting
Download and decompress cronolog # tar zxvf cronolog-1.6.2.tar.gz2, enter the cronolog Installation File directory # cd cronolog-1.6.23, run installation #. /configure # make install 4. Check the directory where cronolog is installed (verify whether the installation is successful) # When which cronolog is normal: /usr/local/sbin/cronolog5. To split catalina of tomcat. (1) Comment out (#) touch "$ CATALINA_BASE"/logs/catalina. out (2) Modify catalina in the tomcat bin directory. two places in the sh file: org. apache. catalina. startup. bootstrap "$ @" start \> "$ CATALINA_ B ASE "/logs/catalina. out 2> & 1 & for org. apache. catalina. startup. bootstrap "$ @" start 2> & 1 \ |/usr/local/sbin/cronolog "$ CATALINA_BASE"/logs/catalina. % Y-% m-% d. out>/dev/null & restart Tomcat after completion. Check whether logs in catalina.2015-09-13.out style exist in the logs file the next day. 6. Versions later than Tomcat 7: 1 Step 1: Set if [-z "$ CATALINA_OUT"]; thenCATALINA_OUT = "$ CATALINA_BASE"/logs/catalina. change outfi to if [-z "$ CATALINA_OUT"]; thenCATALINA_OUT = "$ CATALINA_BASE"/logs/catalina. out. % Y-% m-% dfi 2 Step 2 Change touch "$ CATALINA_OUT" to # touch "$ CATALINA_OUT" Step 3 change org. apache. catalina. startup. bootstrap "$ @" start \> "$ CATALINA_OUT" 2> & 1 & change to org. apache. catalina. startup. bootstrap "$ @" start 2> & 1 \ |/usr/local /Sbin/cronolog "$ CATALINA_OUT">/dev/null & restart Tomcat. Check whether catalina. out.2015-09-13 logs are in the logs file the next 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.