Logrotate

To rotate log files that are growing in service user directories, drop custom logrotate.conf snippets into /etc/local/logrotate/USER. This service is automatically enabled for all service users.

Note

If you store multiple files into this folders, all files will be activated.

Default options will be applied and are continuously documented in /etc/local/logrotate/README.txt.

For details about logrotate, check the logrotate project and it’s documentation.

Here’s an example for a simple rotation signalling the owning process to re-open its file:

/srv/s-test/logs/*.log {
    rotate 5
    weekly

    postrotate
        kill -USR2 $(/srv/s-test/deployment/work/supervisor/bin/supervisorctl pid)
    endscript
}