# ============================================================================
# Cognithor · Logrotate-Konfiguration
# ============================================================================
# Installation:
#   sudo cp deploy/cognithor-logrotate.conf /etc/logrotate.d/cognithor
#   Oder: Symlink von ~/.cognithor/logrotate.d/cognithor
# ============================================================================

/home/*/.cognithor/logs/*.log {
    daily
    missingok
    rotate 14
    compress
    delaycompress
    notifempty
    dateext
    dateformat -%Y-%m-%d
    create 0640
    sharedscripts
    postrotate
        systemctl --user reload cognithor 2>/dev/null || true
    endscript
}

/home/*/.cognithor/logs/*.jsonl {
    daily
    missingok
    rotate 30
    compress
    delaycompress
    notifempty
    dateext
    dateformat -%Y-%m-%d
    create 0640
}

/home/*/.cognithor/logs/audit*.jsonl {
    weekly
    missingok
    rotate 52
    compress
    delaycompress
    notifempty
    dateext
    dateformat -%Y-%m-%d
    create 0640
}
