Skip to content

Logging drivers and log rotation

Select an icon to see what it is.

Step 3 of 6

Rotation keeps a few old files

When the log file reaches max-size, dockerd renames it with a number and starts a new one. It keeps at most max-file files and deletes the oldest. Without these options, a chatty container's file grows until the disk is full.

/var/lib/docker/containers/c5d6e7f8091a2b3cc5d6e7f8091a2b3cc5d6e7f8091a2b3cc5d6e7f8091a2b3c

c5d6e7f8091a2b3cc5d6e7f8091a2b3cc5d6e7f8091a2b3cc5d6e7f8091a2b3c-json.log (current, under 10 MB)
c5d6e7f8091a2b3cc5d6e7f8091a2b3cc5d6e7f8091a2b3cc5d6e7f8091a2b3c-json.log.1 (previous)
c5d6e7f8091a2b3cc5d6e7f8091a2b3cc5d6e7f8091a2b3cc5d6e7f8091a2b3c-json.log.2 (oldest kept, deleted at the next rotation)