How to limit stdout.log file size when running Apache Tomcat as Windows service?

后端 未结 2 1199
余生分开走
余生分开走 2021-02-20 18:22

Is there any way that I could limit the size of the stdout.log file in Apache Tomcat? When running as a service system.out statements go to the stdout

2条回答
  •  闹比i
    闹比i (楼主)
    2021-02-20 18:50

    If you wanted the limit to be 10 megs, you'd use the following conventions

    With log4j:

     -Dlog4j.appender.R.MaxFileSize=10MB 
    

    With JUL:

     -Djava.util.logging.FileHandler.limit=10000000
    

    http://tomcat.apache.org/tomcat-5.5-doc/logging.html

    http://docs.oracle.com/javase/1.4.2/docs/api/java/util/logging/FileHandler.html

提交回复
热议问题