log rotation
Capping log files by size or count so old lines are deleted before they fill the disk.
Without it, logs can fill the disk and take down every service on the host.
In more detail
With the json-file driver, container logs grow forever unless you set max-size and max-file, in daemon.json or per container. A chatty service filling the disk is a common and entirely avoidable outage. The local driver rotates by default.
Examples
A twelve-factor app never rotates its own log files, because it writes none: the bad variant in the course writes quotes.log and must now rotate it, while the good variant leaves storage to the platform.docker run --log-opt max-size=10m --log-opt max-file=3 ...Related terms
- event stream — A continuous, time-ordered flow of events with no fixed beginning or end.
- logging driver — The part of Docker that decides where container logs go, such as a local file or a central log service.
- docker logs — Shows what a container main process wrote to standard output and standard error.
Taught in
- Audit Policy: Choosing What The Cluster Remembers — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Mock Exam: Seventeen Security Tasks Against The Clock — Certified Kubernetes Security Specialist (CKS) Exam Prep
- CloudTrail Logging, Integrity Validation & Athena — Cloud Security & DevSecOps Engineering
- Disposability, Dev Prod Parity And Logs — DevOps & Site Reliability Engineering
- Install Docker And Verify Your Environment — Docker Architecture & Production Containers