Changeset - 1e8458068791
[Not reviewed]
default
0 1 0
Mads Kiilerich - 6 years ago 2020-02-14 13:56:58
mads@kiilerich.com
Grafted from: 1e9efd60d19d
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.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/celerylib/tasks.py
Show inline comments
 
@@ -27,13 +27,13 @@ Original author and date, and relevant c
 
"""
 

	
 
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 @@ from kallithea.model.db import RepoGroup
 
__all__ = ['whoosh_index', 'get_commits_stats', 'send_email']
 

	
 

	
 
log = logging.getLogger(__name__)
 
log = celery.utils.log.get_task_logger(__name__)
 

	
 

	
 
@celerylib.task
0 comments (0 inline, 0 general)