Tomcat automatic cutting log (Windows), tomcat Cutting

Source: Internet
Author: User

Tomcat automatic cutting log (Windows), tomcat Cutting
Step 1: Obtain cronolog

Download cronolog-win32

Step 2: Put cronolog.exe in the bin directory of tomcat after decompression Step 3: Modify the tomcat startup. bat file

Call "% EXECUTABLE %" start % CMD_LINE_ARGS %

Replace

Call "% EXECUTABLE %" run % CMD_LINE_ARGS %

Step 4: Modify the catalina. bat file of tomcat

Add the last few lines, and the red arrow marks the end of each line with the red font

Rem Execute Java with the applicable properties
If not "% JPDA %" = "" goto doJpda
If not "% SECURITY_POLICY_FILE %" = "" goto doSecurity
% _ EXECJAVA % JAVA_OPTS % CATALINA_OPTS % DEBUG_OPTS %-Djava. endorsed. dirs = "% JAVA_ENDORSED_DIRS %"-classpath "% CLASSPATH %"-Dcatalina. base = "% CATALINA_BASE %"-Dcatalina. home = "% CATALINA_HOME %"-Djava. io. tmpdir = "% CATALINA_TMPDIR %" % MAINCLASS % CMD_LINE_ARGS % ACTION % | D: \ apache-tomcat-7.0.54 \ bin \ cronolog.exe D: \ logs \ catalina. % Y-% m-% d. out
Goto end
: DoSecurity
% _ EXECJAVA % JAVA_OPTS % CATALINA_OPTS % DEBUG_OPTS %-Djava. endorsed. dirs = "% JAVA_ENDORSED_DIRS %"-classpath "% CLASSPATH %"-Djava. security. manager-Djava. security. policy = "% SECURITY_POLICY_FILE %"-Dcatalina. base = "% CATALINA_BASE %"-Dcatalina. home = "% CATALINA_HOME %"-Djava. io. tmpdir = "% CATALINA_TMPDIR %" % MAINCLASS % CMD_LINE_ARGS % ACTION % | D: \ apache-tomcat-7.0.54 \ bin \ cronolog.exe D: \ logs \ catalina. % Y-% m-% d. out
Goto end
: DoJpda
If not "% SECURITY_POLICY_FILE %" = "" goto doSecurityJpda
% _ EXECJAVA % JAVA_OPTS % CATALINA_OPTS % JPDA_OPTS % DEBUG_OPTS %-Djava. endorsed. dirs = "% JAVA_ENDORSED_DIRS %"-classpath "% CLASSPATH %"-Dcatalina. base = "% CATALINA_BASE %"-Dcatalina. home = "% CATALINA_HOME %"-Djava. io. tmpdir = "% CATALINA_TMPDIR %" % MAINCLASS % CMD_LINE_ARGS % ACTION % | D: \ apache-tomcat-7.0.54 \ bin \ cronolog.exe D: \ logs \ catalina. % Y-% m-% d. out
Goto end
: DoSecurityJpda
% _ EXECJAVA % JAVA_OPTS % CATALINA_OPTS % JPDA_OPTS % DEBUG_OPTS %-Djava. endorsed. dirs = "% JAVA_ENDORSED_DIRS %"-classpath "% CLASSPATH %"-Djava. security. manager-Djava. security. policy = "% SECURITY_POLICY_FILE %"-Dcatalina. base = "% CATALINA_BASE %"-Dcatalina. home = "% CATALINA_HOME %"-Djava. io. tmpdir = "% CATALINA_TMPDIR %" % MAINCLASS % CMD_LINE_ARGS % ACTION % | D: \ apache-tomcat-7.0.54 \ bin \ cronolog.exe D: \ logs \ catalina. % Y-% m-% d. out
Goto end


Step 5: restart

Files of the corresponding date are generated in the specified directory, and the system time is modified to test whether files of the next day are automatically generated across days.

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.