intermediateMonitoring: Logs, Metrics, Prometheus & Grafana

What problem does log rotation solve, and how do you configure it?

Without rotation, the json-file driver appends to a single ever-growing log file per container, which can exhaust host disk space over time for long-running, chatty services. You configure max-size and max-file either globally in /etc/docker/daemon.json or per-container via --log-opt, capping both individual file size and the number of rotated files retained.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full DevOps Mastery library.

What problem does log rotation solve, and how do you configure it?

Next Step

Continue to What is the difference between Prometheus's pull model and a push-based metrics system?← Back to all Docker questions