Open psyciknz opened 5 years ago
Thanks for sharing this. Even though it's not specific to mqttwarn, and not a bug/issue, I found it helpful. I just freed about 9 GB of logs from various containers.
I initially overlooked this part, which led to some head-scratching: (emphasis mine)
Restart Docker for the changes to take effect for newly created containers. Existing containers do not use the new logging configuration.
So you have to restart the docker service AND recreate the container, for this to go into effect.
Dear @psyciknz,
also thanks for sharing this. Do you see any chance to submit a patch to add this to the documentation at [1] using appropriate command line options like --log-opt max-size=10m
?
With kind regards, Andreas.
Not an issue, but a note worth looking at for those with Docker.
By default, docker does not manage it's own logs for each container. And defaults to json-file. When my system ground to a halt, I found the mqttwarn docker log (since I send to stream), sitting at 7.2gb.
The answer (for me), was to configure the container, or docker service to set a file size limit on the log file: https://docs.docker.com/config/containers/logging/json-file/