Limit the Size of Docker Log Files

It is possible to limit the size of the docker logs using the following configuration options in /etc/docker/daemon.json.

{
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "10M",
        "max-file": "3"
    }
}

Note

It is important that the max-file is a string, not an integer