By default Tomcat appends the date to log files e.g., localhost.2010-12-22.log and same with the catalina log. I don't want the date in the log file and I can't seem to find how to remove it. The logging documentation doesn't say anything about the date pattern. Any ideas are greatly appreciated.
http://tomcat.apache.org/tomcat-6.0-doc/logging.html
You can delete all logs. Those from the current date will not be deletable while Tomcat is running, but that is ok.
None of the other answers helped me much, though Thomas's was closest. The documentation I found was:
So I added the following to Tomcat's logging.properties
file. This removes the date from the localhost logs, and the other three log types that Tomcat dates by default:
1catalina.org.apache.juli.FileHandler.rotatable = false 2localhost.org.apache.juli.FileHandler.rotatable = false 3manager.org.apache.juli.FileHandler.rotatable = false 4host-manager.org.apache.juli.FileHandler.rotatable = false # # default is true, which causes a date to be added to the filename 1catalina.org.apache.juli.FileHandler.suffix = log 2localhost.org.apache.juli.FileHandler.suffix = log 3manager.org.apache.juli.FileHandler.suffix = log 4host-manager.org.apache.juli.FileHandler.suffix = log # # default is .log, but without date, the extra dot is not needed
de_simakov's answer was correct for the most part - but it had a one letter typo. Find a configuration similar to this in conf/server.xml
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="http_access" suffix="log" pattern="common" rotatable="false" resolveHosts="false" />
Notice the rotatable="false" attribute.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With