# HG changeset patch # User Mads Kiilerich # Date 1581685018 -3600 # Node ID 1e84580687919bdcc31e9186b9dee250e790237a # Parent 046fbed12f70f9ccd52a22c908ca912615d36249 celery: fix logging from inside tasks Celery will hijack the global logging configuration and disable the usual Kallithea logging (unless CELERYD_HIJACK_ROOT_LOGGER is set False). Fixed partially by using the special celery loggers inside the tasks. Logging from modules will still not work. diff -r 046fbed12f70 -r 1e8458068791 kallithea/lib/celerylib/tasks.py --- a/kallithea/lib/celerylib/tasks.py Thu Feb 13 16:41:51 2020 +0100 +++ b/kallithea/lib/celerylib/tasks.py Fri Feb 14 13:56:58 2020 +0100 @@ -27,13 +27,13 @@ """ import email.utils -import logging import os import traceback from collections import OrderedDict from operator import itemgetter from time import mktime +import celery.utils.log from tg import config import kallithea @@ -50,7 +50,7 @@ __all__ = ['whoosh_index', 'get_commits_stats', 'send_email'] -log = logging.getLogger(__name__) +log = celery.utils.log.get_task_logger(__name__) @celerylib.task