:: Re: [DNG] Docker daemon logrotate
Góra strony
Delete this message
Reply to this message
Autor: dng@d404.nl
Data:  
Dla: dng
Temat: Re: [DNG] Docker daemon logrotate
On 09-04-2024 04:26, Tom via Dng wrote:
> Hi
>
> I’m trying to work out how docker daemon logging should be configured for log rotation.
>
> There doesn’t appear to be any default logrotate config for /var/log/docker.log in either upstream docker-ce or debian docker.io packages and I have noticed that some of my machines have docker.log files getting above 8Gb in size.
>
> I have set "log-driver": "local" in /etc/docker/daemon.json but I can’t find if that should have any affect on the daemon /var/log/docker.log or if it is just for container logs.
>
> Should I be adding my own custom config to /etc/logrotate.d/docker?
>
> Tom
>

Only setting "log-driver": "local" does not make logrotate work. A more
complete rule is:

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

and your are correct this is just the logging from within containers. 
The docker daemon self logs to daemon.log afaik.

You have to restart the running containers for this change in
configuration to work.

Grtz.

Nick