You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When deploying in a cloud context (kubernetes in my case), one usually wants to send all logs to the container's stdout (in a coherent format) and collect them with some log aggregator (e.g. Promtail + Loki). Currently that is only possible for this image with some crude config overrides. My current workaround is:
Core:
Override multiple [logging.*].path settings to point to /dev/stdout via mailman-extra.cfg
chown mailman /dev/stdout before running docker-entrypoint.sh via a custom container command (supplied in Pod spec)
Web:
For Django: Override the entire LOGGING config variable via settings_local.py to redirect django logs to stdout
For UWSGI: Mount a custom uwsgi.ini into /opt/mailman-web, replacing the container-packaged one and omitting all logger definitions (which makes UWSGI send logs to stdout by default)
One or more dedicated environment variables to make the entire mailman suite switch to this logging behavior would be quite helpful and feel less hacky. I'd be willing to make a PR.
The text was updated successfully, but these errors were encountered:
Thanks for opening this, i've been thinking about this for a while too.
The steps you have makes sense to me. Here are a few suggestoins:
Override multiple [logging.*].path settings to point to /dev/stdout via mailman-extra.cfg
You can do this by propagating all the sub-loggers to main by specifying propagate: yes under each [logging.*] loggers and only updating path for the root logger.
We can use something like MAILMAN_LOG_TO_STDOUT as a way to configure the containers for the same.
I'd be happy to accept a PR if you open one for the same 👍🏽
When deploying in a cloud context (kubernetes in my case), one usually wants to send all logs to the container's stdout (in a coherent format) and collect them with some log aggregator (e.g. Promtail + Loki). Currently that is only possible for this image with some crude config overrides. My current workaround is:
[logging.*].path
settings to point to/dev/stdout
viamailman-extra.cfg
chown mailman /dev/stdout
before runningdocker-entrypoint.sh
via a custom container command (supplied in Pod spec)LOGGING
config variable viasettings_local.py
to redirect django logs to stdoutuwsgi.ini
into/opt/mailman-web
, replacing the container-packaged one and omitting all logger definitions (which makes UWSGI send logs to stdout by default)One or more dedicated environment variables to make the entire mailman suite switch to this logging behavior would be quite helpful and feel less hacky. I'd be willing to make a PR.
The text was updated successfully, but these errors were encountered: