jsm...@hubspot.com
unread,May 6, 2013, 6:29:37 PM5/6/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gets...@googlegroups.com
I've got Sentry logging working great with my Django project but I've having an odd problem with reporting errors from inside Celery tasks.
I'm getting two events for every exception logged, one from celery.worker.log and one from the root logger. The one from the root logger doesn't have any of the log-related "additional data" that the one from celery.worker.log has (like message, pathname, filename, etc).
As far I know, I'm not using the error-line reporting stuff, just the exception reporting stuff. Can anyone tell which config bits have I missed?
Here's the task:
@task
def raise_celery_task_exception():
raise Exception("Testing exception reporting from Celery")
I'm running celery with "manage.py celery worker -B --loglevel=INFO"
Here's the relevant parts of my settings.py:
INSTALLED_APPS = (
...
'djcelery',
'raven.contrib.django.celery',
'raven.contrib.django.raven_compat',
...
)
RAVEN_CONFIG = {
'dsn': REMOVED
}
CELERY_IGNORE_RESULT = True
CELERY_DISABLE_RATE_LIMITS = True
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname) -8s %(asctime)s [%(name)s %(funcName)s:%(lineno)s] %(message)s',
},
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'verbose'
},
},
'loggers': {
'celery': {
'level': 'WARNING',
},
},
'root': {
'level': 'INFO',
'handlers': ['console']
}
}