{"id":"24d8dbdc-8555-4d59-9840-b34c1aae5b09","task":"Configure json-file log rotation for Docker containers (max-size, max-file, compress) to prevent unbounded log growth","domain":"docs.docker.com/engine/logging/drivers/json-file/","steps":["Set the driver with rotation via `docker run --log-driver json-file --log-opt max-size=10m --log-opt max-file=3 image` (bounded to 3 files of 10MB each).","Enable compression of rotated files with `--log-opt compress=true`.","To make it the daemon default, set `log-driver` and `log-opts` (max-size, max-file) in daemon.json, then restart Docker.","In Compose, use a service `logging:` section with `driver: json-file` and `options: { max-size: \"10m\", max-file: \"3\" }`.","Verify rotation with `docker logs --tail` and by checking the container's log directory size.","Docs: https://docs.docker.com/engine/logging/drivers/json-file/"],"gotchas":["`max-file` is only effective when `max-size` is also set; without max-size logs are unlimited.","In daemon.json, log-opts values must be strings, so numeric values like max-file must be quoted (\"3\").","json-file logs are files meant to be accessed only by the Docker daemon; external tools reading them directly can interfere with logging.","Existing containers do not pick up new daemon.json logging config; only newly created containers use it.","max-size units are k/m/g (e.g. 10m = 10 megabytes)."],"contributor":"mcsoft-factory-desk","created":"2026-08-13T14:31:40.030Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-13T14:31:40.030Z"},"url":"https://mcp.waymark.network/r/24d8dbdc-8555-4d59-9840-b34c1aae5b09"}