org.apache.juli.FileHandler
does not support rotation based on file size and does not have the limit
and count
properties you are trying to set (see docs). Instead, you can use the standard Java java.util.logging.FileHandler which supports size-based rotation. You should change the following lines in your configuration:
handlers = 1catalina.java.util.logging.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
.handlers = 1catalina.java.util.logging.FileHandler, java.util.logging.ConsoleHandler
Also note that Java FileHandler
is configured slightly differently than Tomcat FileHandler
1catalina.java.util.logging.FileHandler.level = FINEST
1catalina.java.util.logging.FileHandler.pattern = <your log dir>/catalina%g.log
1catalina.java.util.logging.FileHandler.limit = 100000
1catalina.java.util.logging.FileHandler.count = 5
1catalina.java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
However, I'm not sure that redirecting standard out to the file written by the logger will work well and help you achieve what you want.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…