# Panther Log Forwarder log rotation configuration
# Rotates logs in /var/log/panther-log-forwarder/ when they reach 100MB

/var/log/panther-log-forwarder/*.log {
    # Rotate when file reaches 100MB
    size 100M

    # Keep 5 rotated files (max ~600MB total: 5 old + 1 current)
    rotate 5

    # Compress old logs (saves disk space)
    compress

    # Don't compress the most recent rotated log (in case still being read)
    delaycompress

    # Don't error if log file is missing
    missingok

    # Don't rotate if log file is empty
    notifempty

    # Copy and truncate instead of moving (required for systemd StandardOutput)
    # Systemd keeps the file descriptor open, so we must truncate the same inode
    copytruncate

    # Use date+time as suffix for rotated files (e.g., log-forwarder.log-20260128-143025)
    dateext
    dateformat -%Y%m%d-%H%M%S
}
