Here is another script I need to keep handy for the future. My logrotate script for Play Framework applications. The important thing here is the parameter “copytruncate”. I tried many times without it and the result was always the same: after the logrotate was done no more logging was made by the application. “copytruncate” solved this
/opt/myapp/logs/*.log { missingok notifempty size 50M copytruncate create 0644 root root rotate 9999 }
How to run logrotate manually:
logrotate --force /etc/logrotate.d/myapp
Tested on Ubuntu 14.04 and Play Framework 2.3
0 Comments.