Skip to content

Allow mix tasks to always run with debug logging

feld requested to merge fix/mix-task-logging into develop

By setting logging levels with :config, :logger, level we end up stripping all of the logs from the binaries that do not meet the specified logging level. This causes problems especially in production where you might be running your logging level at :warn to skip unwanted info and debug logs. This means that your mix tasks will also run with a minimum of :warn, causing Logger.info() statements to be lost.

The safe way to set logging levels is in the backend itself.

:config, :logger, :console, level: :warn == GOOD

:config, :logger, level: :warn == BAD

This MR addresses this issue by explicitly setting the logging levels for the backends. This allows us to then set logging level to :debug for mix tasks and have it work regardless of your Pleroma dev/test/prod config because the logging lines we need are never stripped from the resulting binaries.

Merge request reports