My Play Framework logrotate configuration

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 {
  size 50M
  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

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">

This site uses Akismet to reduce spam. Learn how your comment data is processed.