# AI Cats — logrotate config for application logs.
#
# Install:
#   sudo cp scripts/logrotate-ai-cats.conf /etc/logrotate.d/ai-cats
#   sudo chown root:root /etc/logrotate.d/ai-cats
#   sudo chmod 0644 /etc/logrotate.d/ai-cats
#
# Test without rotating:
#   sudo logrotate -d /etc/logrotate.d/ai-cats
#
# Force-rotate now (e.g. for verification):
#   sudo logrotate -f /etc/logrotate.d/ai-cats
#
# Logger writes with file_put_contents() + FILE_APPEND on every call, so it
# reopens the file by path each write — plain `create` works, no copytruncate.
# The 50M size guard matches LogReader's read cap so files never grow past
# the point where the UI can display them.
#
# Adjust the `create` mode/user/group to match the PHP-FPM (or Apache mpm_prefork)
# pool that runs this app. Common values: `www-data www-data` on Debian/Ubuntu,
# `apache apache` on RHEL/Rocky.

/var/www/html/ai_cats/logs/app.log
/var/www/html/ai_cats/logs/error.log
{
    daily
    rotate 14
    maxsize 50M
    compress
    delaycompress
    missingok
    notifempty
    create 0640 www-data www-data
    sharedscripts
}
