docker-mailman icon indicating copy to clipboard operation
docker-mailman copied to clipboard

[BUG] Logs not rotating

Open p3lim opened this issue 3 years ago • 5 comments

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.

p3lim avatar Jan 31 '22 10:01 p3lim

Containers don’t have a cron job, but we can do something about log rotation by configuring mailman-web/mailman-core or something.

maxking avatar Apr 14 '22 06:04 maxking

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 }

mistermatt2u avatar Mar 28 '23 06:03 mistermatt2u

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.

jeensg avatar Aug 26 '23 19:08 jeensg

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.

yaseppochi avatar Aug 27 '23 06:08 yaseppochi