docker-mailman
docker-mailman copied to clipboard
[BUG] Logs not rotating
Tag/version of Container Images 0.3.*, 0.4.*
Logs are never rotated, we had mailman/wsgi logs that exceeded 100GB in total.
This should be fairly trivial to fix, just adding policies to /etc/logrotate.d and running logrotate in a cron job.
Containers don’t have a cron job, but we can do something about log rotation by configuring mailman-web/mailman-core or something.
Below is a script I placed in /etc/logrotate.d/mailman to address this issue. I believe this will rotate the logs every week, by default. You would need to confirm where your logs are stored, as that may be dependent on how you have configured your containers.
#rotate logs for Mailman (Docker) #logs are in various locations within /opt/mailman
"/opt/mailman/core/var/logs/*.log" { postrotate docker-compose -f /opt/mailman/docker-mailman/docker-compose.yaml restart mailman-core endscript }
"/opt/mailman/web/logs/*.log" { postrotate docker-compose -f /opt/mailman/docker-mailman/docker-compose.yaml restart mailman-web endscript }
Are there any news on this? Just found my logs to be quite large after 2 years ... and don't know exactly on how to proceed with @mistermatt2u s suggestion.
I'm not familiar with the current Docker setup, so it's possible rotation is not configured. Even once it's configured, most likely https://gitlab.com/mailman/mailman/-/issues/931 is also a problem.