How can I make log4j reopen log files periodically (logrotate)
Question
My sysadmin has been "encouraging" me to fix our web application logs to play nicely with logrotate. The problem is that after logrotate works on a file the application stops logging. Is there a way to configure log4j to reopen log files after this happens?
This comment explains the general problem but doesn't provide a solution for log4j: https://stackoverflow.com/a/6514233/201748
Solution
I have still to test it, but the copytruncate
option of logrotate should do.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow