Tomcat Automatic cutting log (Windows)

Source: Internet
Author: User

First step: Get Cronolog

Download Cronolog-win32

Step Two: Unzip and place the Cronolog.exe in the Tomcat bin directoryStep Three: Modify Tomcat's Startup.bat file

Call "%executable%" Start %cmd_line_args%

Replaced by

Call "%executable%" run %cmd_line_args%

Fourth Step: Modify Tomcat's Catalina.bat file

In the last few lines, add the Red arrows to the end of each line with the red font portion

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
:d osecurity
%_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
:d OJPDA
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
:d OSECURITYJPDA
%_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


Fifth step: restart

A file of the corresponding date is generated under the specified directory, and the system time test is automatically generated after the next day

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Tomcat Automatic cutting log (Windows)

Related Article

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.