问题
I have wrote below configuration in my logging.properties:
2localhost.org.apache.juli.AsyncFileHandler.level = FINE
2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.AsyncFileHandler.maxDays=5
2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
Logs write in log file perfectly but maxDays properties is not working. Means I have manually run my application after changing date up-to 6 days but log file not deleted after maxDays is reach.
Description of maxDays properties on https://tomcat.apache.org/tomcat-8.5-doc/logging.html: By default the log files will be kept on the file system forever. This may be changed per handler using the handlerName.maxDays property. If the specified value for the property is <=0 then the log files will be kept on the file system forever, otherwise they will be kept the specified maximum days.
Can you please help to verify applied configruation is correct or not ? or I understood maxDays properties usage wrong.
回答1:
Same problem here. Currently I'm using Tomcat 8.5.4. I found this link mentioning that I will need version 8.5.16 or higher to use this feature.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61105
来源:https://stackoverflow.com/questions/45633872/tomcat-8-5-org-apache-juli-maxdays-property-not-working