RU RU

All Posts

Logrotate and Docker: Why and How?

September 5, 2025


Logrotate and Docker: Why and How?

Introduction

Logrotate is a powerful tool for log management in Linux, but its interaction with Docker has its own specifics. This guide explains how to properly use logrotate with Docker containers and when it’s better to rely on Docker’s built-in log management tools.


Docker Containers and Logs

Docker collects logs from the standard output streams (stdout and stderr) of containers and, by default, stores them as JSON files: