# PYRE / Prometheus Protocol — logrotate config.
#
# INERT until logs are actually being produced (PM2 apps running / nginx
# serving). The paths below will simply be skipped (missingok) until then.
#
# Install (run as a privileged user):
#   sudo cp /home/pyre/pyre/infra/logrotate/pyre /etc/logrotate.d/pyre
#   sudo logrotate --debug /etc/logrotate.d/pyre   # dry-run to validate
#
# copytruncate is used so PM2 and nginx keep writing to the same file handle
# (no restart/reopen needed after rotation).

# ---- PYRE app logs (written by PM2) ----------------------------------------
/home/pyre/pyre/logs/*.log {
    su pyre pyre
    daily
    rotate 14
    compress
    delaycompress
    missingok
    notifempty
    copytruncate
}

# ---- nginx logs for feedthepyre ---------------------------------------------
/var/log/nginx/feedthepyre.*.log {
    daily
    rotate 14
    compress
    delaycompress
    missingok
    notifempty
    copytruncate
}
