Skip to content

Refactor logging

Bengfort requested to merge refactor-logging into main

I am still not happy about our logging config. I have already tried something similar to this in !1549 (closed), but we decided against it. This time around the proposal is slightly different, but at its core it is still about moving the logging out of default settings. This means that you will not get monitoring logs if you do not configure logging yourself.

I cannot really remember why we decided against it 4 month ago. This approach is slightly different, so maybe it is more successful.

The reasons for moving the config are:

  • The logging config is notoriously hard to extend, so as soon as you need to adjust even a tiny detail you usually need to replace the whole thing anyway.
  • It is not uncommon to want to adapt the logging config, e.g. to configure syslog or change the monitoring log file path.
  • Django's default config is not that bad: It sends emails to admins on errors and does not leak the monitoring logs. It is debatable whether our default config is actually an improvement.
  • Currently we have development/docker specific logic in the default settings (LOG_DIR). This is slightly confusing especially since the default config doubles as documentation for available settings).

Merge request reports