Properly declare a centralized logging configuration and then reuse
We need to simplify and centralize once and for all our logging configuration so it becomes clearer and more maintainable. They grew organically around multiple different implementation or services (celery task, gunicorn, cli...).
@olasd proposed a clear plan for that [1]
-
lift the logic [2] into a common utility function (moved to swh.core.logging/logger)
-
Drop the celery task backend configuration logging in favor of a call to the new utility function ^, pulling its arguments from a couple of environment variables (and the celery command line if relevant). Ensure the envvars are consistent with the ones that the swh command line supports.
-
Replace the gunicorn logconfig.ini [4] and the associated setup [5] to use the same utility function, with consistent environment variables.
-
Coalesce all the ad-hoc logger.setLevel calls strewn across our codebase, as well as gunicorn's hardcoded logconfig.ini, into a (bunch of) common yaml logging setup file(s) defined in puppet and docker.
-
update all the entry points / puppet deployment manifests / ... to use that common config file and envvar
-
[1] Copy/pasted from the excellent plan swh-loader-core!365 (closed)
-
[2] https://forge.softwareheritage.org/source/swh-core/browse/master/swh/core/cli/init.py$137-156
-
[4] https://forge.softwareheritage.org/source/puppet-swh-gunicorn/browse/master/files/logconfig.ini
Migrated from T4229 (view on Phabricator)