The default with nothing set
No rotation at all, and the disk it fills is the one the daemon needs
json-file
Set up container logging that does not fill the disk. The default driver has no rotation at all, which is the commonest way a Docker host stops working.
Or drop a file anywhere on this panel. Nothing is uploaded: the analysis runs in this tab.
The answer appears here
Paste on the left and press Generate. Nothing leaves this tab.
Nothing else to flag.
No formatting problems, and nothing the rules object to. Worth remembering what that covers: this reads the file you pasted, not the account or cluster it will be applied to.
No finding matches that filter.
Real input you can load into the tool above. Each one shows a different thing going wrong, because that is what the tool is for.
No rotation at all, and the disk it fills is the one the daemon needs
json-file
Blocks the application when the collector is unreachable, unless async is on
fluentd
Capped, and the cap is per container rather than per host
json-file max-size: 50m max-file: 5
These are the ones that fail silently. The config is accepted, nothing raises an error, and the consequence arrives later.
There is no rotation. The logs grow until the Docker partition is full, at which point the daemon itself stops working rather than just that container.
Instead:Set max-size and max-file in /etc/docker/daemon.json so it applies to everything, then recreate the containers.
The container holds the file open, so the space is not released until the process closes it or the container is removed.
Instead:Recreate the container, or restart the daemon after fixing the rotation settings.
The configuration is fixed when a container is created. Restarting changes nothing.
Instead:docker compose up -d --force-recreate, and verify with docker inspect.
json-file writes under the Docker data root. When that partition fills, the daemon cannot write its own state either, so containers stop, new ones will not start, and docker commands begin failing.
The container holds it open, so the inode stays allocated until the process closes it or the container is removed. The classic recovery of emptying the log with a redirect frees nothing and looks like it worked.
max-size 10m with max-file 3 caps each container at about 30 MiB. Fifty containers is a gigabytes and a half, which is the number to compare against the partition, and the one people work out afterwards.
It rotates by default at 20 MiB across five files and stores logs more compactly, and docker logs works identically. The only cost is that the on-disk format is not JSON, so anything reading the files directly has to change.
fluentd is the notable one: by default the daemon blocks when it cannot reach the collector, so writes to stdout block and the application stops. fluentd-async=true buffers instead. syslog is different again: the daemon keeps no local copy, so docker logs returns nothing and an unreachable endpoint means the logs are simply gone.
The logging configuration is fixed at creation, so restarting the daemon or the containers changes nothing. They have to be recreated, which is why the setting so often appears to have done nothing at all.
An application writing to a file inside the container is invisible to every driver, and that file grows in the writable layer where nothing rotates it. This is why the official nginx image symlinks its logs to /dev/stdout.