From b3d3d33c96201d24c461d8fd11683d350b1d8d96 Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Mon, 23 Aug 2021 13:26:25 +1000 Subject: [PATCH] Don't disable existing loggers when initialising Celery. Prior to this change, the Celery logging did not include any of the logging calls within MediaGoblin because `disable_existing_loggers` defaulted to True. This was unhelpful and inconsistent with the logging behaviour of the web process. The MediaGoblin web process sets logging output based on the configuration in paste.ini. This is loaded by the `paster` program, rather than MediaGoblin itself. The MediaGoblin celery process manually loads its logging config from paste.ini, but previously defaulted to `disable_existing_loggers=True`, meaning that none of the application logging flowed through unless the logger was explicitly added to paste.ini. --- docs/source/siteadmin/relnotes.rst | 1 + mediagoblin/init/celery/from_celery.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/siteadmin/relnotes.rst b/docs/source/siteadmin/relnotes.rst index 03d8db06..78342d99 100644 --- a/docs/source/siteadmin/relnotes.rst +++ b/docs/source/siteadmin/relnotes.rst @@ -50,6 +50,7 @@ This chapter has important information about our current and previous releases. - Fix test suite on Debian 11 (Ben Sturmfels) - Remove reference to jsonschema.compat no longer available upstream (Marco Pessotto) - Fix images being marked as failed after Celery restart [#5608] (Ben Sturmfels) +- Fix app logging calls not showing in Celery logs (Ben Sturmfels) 0.11.0 diff --git a/mediagoblin/init/celery/from_celery.py b/mediagoblin/init/celery/from_celery.py index 0c80a961..afa86dde 100644 --- a/mediagoblin/init/celery/from_celery.py +++ b/mediagoblin/init/celery/from_celery.py @@ -45,7 +45,7 @@ def setup_logging_from_paste_ini(loglevel, **kw): raise OSError('{} does not exist. Logging can not be set up.'.format( logging_conf_file)) - logging.config.fileConfig(logging_conf_file) + logging.config.fileConfig(logging_conf_file, disable_existing_loggers=False) hook_runall('celery_logging_setup')