Cloud Dev Notes

infra diary / small notes / repeatable fixes

Docker Logs: Rotation Before It Hurts

2026-02-14 · Docker · Ops

Containers that log heavily can fill disks. The fix is boring and should be done on day one: set log rotation caps and confirm they are actually active on the running container.

Sane defaults

logging:
  driver: "json-file"
  options:
    max-size: "50m"
    max-file: "5"

Verify what is active

docker inspect <container> --format '{{json .HostConfig.LogConfig}}'

If you changed the compose file but did not recreate the container, the old settings may still be in effect. Use a force recreate when you need to be sure.