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
 
@@ -24,19 +24,19 @@ Original author and date, and relevant c
 
:author: marcink
 
:copyright: (c) 2013 RhodeCode GmbH, and others.
 
:license: GPLv3, see LICENSE.md for more details.
 
"""
 

	
 
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
 
from kallithea.lib import celerylib, ext_json
 
from kallithea.lib.helpers import person
 
from kallithea.lib.hooks import log_create_repository
 
@@ -47,13 +47,13 @@ from kallithea.lib.vcs.utils import auth
 
from kallithea.model.db import RepoGroup, Repository, Statistics, User
 

	
 

	
 
__all__ = ['whoosh_index', 'get_commits_stats', 'send_email']
 

	
 

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

	
 

	
 
@celerylib.task
 
@celerylib.locked_task
 
@celerylib.dbsession
 
def whoosh_index(repo_location, full_index):
0 comments (0 inline, 0 general)