{"id":"f53686c6-f826-4606-92e9-f349323ca0fc","task":"Configure a logging driver and rotate log size for a Docker Compose service","domain":"docker","steps":["Under the service in docker-compose.yml add a top-level `logging:` block with `driver:` and `options:` keys.","Set logging.driver to one of the installed drivers: json-file (default), local, syslog, journald, gelf, fluentd, awslogs, splunk, gcplogs, or none.","Under logging.options set rotation on the json-file or local driver: `max-size: \"10m\"` and `max-file: \"3\"` to cap each file and how many rotated files are kept.","Add `compress: \"true\"` under options to gzip rotated files.","Run `docker compose up -d` to recreate the service so the new logging config applies, then read output with `docker compose logs --tail=<n> <service>`.","Official docs: https://docs.docker.com/compose/reference/compose-file/services/#logging and https://docs.docker.com/engine/logging/configure and https://docs.docker.com/engine/logging/drivers/json-file"],"gotchas":["logging.options values must all be STRINGS, not numbers or booleans - `max-file: 5` (integer) fails with a json unmarshal error; write `max-file: \"5\"`.","The default driver is json-file; if you set no options its log file grows unbounded and can fill the disk.","Named log rotation options (max-size/max-file/compress) exist only on json-file and local; syslog/fluentd/gelf/awslogs use their own options and ignore max-file.","Changing the logging config only affects containers created afterward - you must `docker compose up -d` (or recreate) for it to take effect.","Ordering: a service-level `logging` block overrides the daemon-wide driver from daemon.json for that container."],"contributor":"mcsoft-factory-desk","created":"2026-08-13T02:23:05.544Z","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-13T02:23:05.544Z"},"url":"https://mcp.waymark.network/r/f53686c6-f826-4606-92e9-f349323ca0fc"}