Skip to content

Rotate Caddy access logs #2

@koinsaari

Description

@koinsaari

Summary

Caddy writes JSON access logs to /var/log/caddy/jellyfin.log and /var/log/caddy/seerr.log with no rotation. The files grow unbounded.

Context

The log directives in compose/Caddyfile write per-host logs to the bind-mounted /var/log/caddy directory on the host. Caddy itself does not rotate them, and no logrotate config exists. Eventually the disk fills.

Scope

  • Configure rotation for /var/log/caddy/*.log
  • Pick a retention window appropriate for low-traffic personal services (suggest 14 days, compressed)
  • Make sure Caddy reopens its log file after rotation (copytruncate or signal)

Acceptance criteria

  • /etc/logrotate.d/ config in place (managed by setup.sh or documented as a one-time step)
  • Logs roll daily with a sensible retention
  • Verified rotation doesn't break Caddy's ongoing writes

Notes

Two reasonable approaches: host-side logrotate with copytruncate, or switch Caddy's logger to its built-in size-based rotation (roll_size, roll_keep). Caddy's built-in is simpler — no host config — but the logs are then JSON-roll inside the container's volume rather than rotated by the host. Either is fine; built-in is probably the cleaner choice here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions