checkId: check.logs.rotation.configured plugin: stellaops.doctor.observability severity: warn tags: [observability, logs]

Log Rotation

What It Checks

Verifies that log rotation is configured to prevent disk exhaustion. The check:

Why It Matters

Without log rotation, log files grow unbounded until they exhaust disk space. Disk exhaustion causes cascading failures across all services. Even before exhaustion, very large log files are slow to search and analyze during incident response.

Common Causes

How to Fix

Docker Compose

Set application-level log rotation:

environment:
  Logging__RollingPolicy: "Size"
  Serilog__WriteTo__0__Args__rollingInterval: "Day"
  Serilog__WriteTo__0__Args__fileSizeLimitBytes: "104857600"  # 100MB

Bare Metal / systemd

Option 1 – Application-level rotation in appsettings.json:

{
  "Logging": {
    "RollingPolicy": "Size"
  }
}

Option 2 – System-level logrotate:

sudo cp /usr/share/stellaops/logrotate.conf /etc/logrotate.d/stellaops

# Or create manually:
cat <<EOF | sudo tee /etc/logrotate.d/stellaops
/var/log/stellaops/*.log {
    daily
    rotate 14
    compress
    missingok
    notifempty
    maxsize 100M
}
EOF

Kubernetes / Helm

logging:
  rollingPolicy: "Size"
  maxFileSizeMB: 100
  retainFiles: 14

Verification

stella doctor run --check check.logs.rotation.configured