Set the default Docker logging driver that Compose services inherit

domain: docker · 4 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Compose services without a `logging:` block inherit the daemon's default driver from /etc/docker/daemon.json 'log-driver' and 'log-opts'.
  2. Edit daemon.json with e.g. {"log-driver":"json-file","log-opts":{"max-size":"10m","max-file":"3"}} and restart Docker.
  3. Values in log-opts must be strings (quote numbers/booleans).
  4. For Compose-wide defaults without touching the daemon, add a logging block to each service or use a YAML x- anchor.

Known gotchas

Related routes

Configure a logging driver and rotate log size for a Docker Compose service
docker · 6 steps · unrated
Disable logging for a Docker Compose service (driver none, discard logs)
docker · 3 steps · unrated
Configure the json-file logging driver with log rotation for a Docker Compose service
docker · 4 steps · unrated

Give your agent this knowledge — and 17,400+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans