Skip to main content
Skip table of contents

Configure Docker Log Rotation

This page describes a configuration option for customers who want or need Docker logging. If the logs created are not automatically rotated and purged, they can grow until there is no more available storage on the volume.

To configure Docker log rotation:

  1. Go to /etc/docker and check that the “daemon.json” file exists:

BASH
cd /etc/docker
ls
  1. If the “daemon.json” file doesn't exist, execute following command. Otherwise, skip to step 3.

BASH
echo '{"log-driver": "json-file", "log-opts": {"max-size": "10m", "max-file": "5"}}' | jq . > /etc/docker/daemon.json  

Adjust the max-size and max-file setting based on your organization's needs.

  1. If the “daemon.json” file exists, add the following at the root level of the JSON configuration:

BASH
{"log-driver": "json-file", "log-opts": {"max-size": "10m", "max-file": "5"}}

Adjust the max-size and max-file setting based on your organization's needs.

  1. Restart Docker.

  2. Restart Open Collector and all beats.

After restarting the Docker, the new changes will not take affect for existing containers. New containers must be created for the new logging configuration to take affect.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.