Set Docker log limits before the disk fills
A short check for growing container logs: identify usage, configure rotation and verify it without blindly deleting files or losing evidence.

Technical source: Docker’s json-file logging documentation. The checklist is this note’s independent proposal.
Deleting logs quickly when a disk fills can hide the symptom and destroy evidence. I suggest assigning log ownership and retention limits before an incident.
Identify consumption first
- Separate host disk consumption from application data size.
- Inspect the actual container’s log driver and effective settings.
- Correlate repeated messages with the start of growth.
With json-file, size and file-count limits can be set. This educational example is only a Compose service’s logging section; suitable limits need local assessment:
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
Written configuration is not active configuration
Changing daemon defaults does not automatically update existing containers. Apply changes through the deployment process with a change plan and verification. Do not directly manipulate internal log files; Docker manages them.
Free disk space is not the finish line
In a hypothetical example, a connection error produces continuous messages. Rotation limits growth but does not repair the connection. Recheck message rate and ability to investigate incidents after fixing it.
Document the retention owner, required period and capacity alert. Tiny limits without an evidence-retention route can create another problem.
Source checked: November 2, 2026. The example is not a universal server setting or a data-deletion instruction.


