kb
01.02.2012 16:33 c8541125
Победитель конкурса "самый раздражающий джаваскрипт". http://www.colinhowe.co.uk/2011/02/08/ce...
Попробуйте выделить кусочек код-сэмпла.
# Hook up sentry to celery's logging
import logging
from celery.signals import task_failure
from sentry.client.handlers import SentryHandler
logger = logging.getLogger('task')
logger.addHandler(SentryHandler())
def process_failure_signal(exception, traceback, sender, task_id,
signal, args, kwargs, einfo, **kw):
exc_info = (type(exception), exception, traceback)
logger.error(
'Celery job exception: %s(%s)' % (exception.__class__.__name__, exception),
exc_info=exc_info,
extra={
'data': {
'task_id': task_id,
'sender': sender,
'args': args,
'kwargs': kwargs,
}
}
)
task_failure.connect(process_failure_signal)