Docker receives logs from the container and writes them to the directory of the running container:
/var/lib/docker/containers/[container-id]/[container-id]-JSON.log
Something is always logged. If errors or constellations occur where more is logged, these log files can also become larger. In the worst case, too large for the disc space.
Docker provides log rotation functions for these log files. The necessary parameters are entered in the respective docker-compose.override.yml:
logging:
options:
max-size: "1m"
max-file: "3"
#compress: "true"
The parameters belong in the configuration of each individual container.
The parameters in the example still allow sufficient troubleshooting retrospectively.
You can still activate the compression. If you want to keep it for a long time…
When the containers are updated, the entire directory including the log files is deleted.
With regular updates and normal log volumes, this should not cause any problems.
However, log rotation should be switched on for greater operational security.
To activate the change:
cd /etc/egroupware-docker
docker-compose restart
For questions, suggestions, etc., please create a separate topic in the forum and refer to this article.