Closed kujiy closed 6 years ago
@kujiy the usual way to rotate logs on tomcat is simply to truncate the file after creating a copy of it (copytruncate
logrotate option). see: tomcat-8.0.logrotate (Fedora package).
Since this is not ideal you could also let log4j rotate the files for you.
@antoineco Oh my goodness, copytruncate will be the best! I'll try it next week. Thank you!
Closing, since this appears to be resolved. Since catalina.sh
is running as PID 1 inside the container, it cannot be restarted without restarting the entire container. Hopefully the copytruncate
suggestion works for you!
In the future, these sorts of questions/requests would be more appropriately posted to the Docker Community Forums, the Docker Community Slack, or Stack Overflow.
It seems that there's no restart option for catalina.sh. I'd like to restart just my tomcat service from inside the container for logrotate, not from the docker host. Unfortunately, I don't have its source so I can't touch the app. Does anybody know how to restart or regenerate its log file?