Open dbrgn opened 11 years ago
I managed to make it work, but for some reasons it doesn't seem to work once deployed in production..
Here's my config:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'root': {
'level': 'WARNING',
'handlers': ['sentry'],
},
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
},
},
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'sentry': {
'level': 'ERROR',
'class': 'raven.contrib.django.handlers.SentryHandler',
},
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
},
'console':{
'level':'DEBUG',
'class':'logging.StreamHandler',
'formatter': 'simple'
},
},
'loggers': {
'django.request': {
'handlers': ['mail_admins', 'console', 'sentry'],
'level': 'DEBUG',
'propagate': True,
},
'dajaxice': {
'handlers': ['console', 'sentry'],
'level': 'WARNING',
'propagate': False,
},
'sentry.errors': {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': False,
},
'raven': {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': False,
},
}
}
Ok .. after much more digging I found out what's going on.
This is a problem with dajaxice, not sentry :)
This is caused by dajaxice not logging the traceback. An issue about this problem is open since 4 months ..
https://github.com/jorgebastida/django-dajaxice/issues/88
I forked it and will make a pull request, but the development of dajaxice seems quite slow.. I don't know if it will ever get merged.
Meanwhile my fixed repo is available here:
https://github.com/h3/django-dajaxice/tree/88_logging_traceback_fix
Is it possible to integrate dajax/dajaxice with Sentry/Raven? I tried to add a logger, but nothing seems to get sent to my server, even though I triggered an error in the ajax view in production mode.
My logging config: