Django logging and sentry
Django-sentry has been a fairly useful tool for me. The docs are good but they only talk about integrating with logging the old way.
Here’s how to use Sentry with logging dictionary config:
LOGGING = {
'version': 1,
'formatters': {
'verbose': {
'format': '%(asctime)s %(levelname)-8s [%(name)s] -- %(message)s'
},
},
'handlers': {
//...
'sentry': {
'level': 'WARNING',
'class': 'sentry.client.handlers.SentryHandler',
'formatter': 'verbose',
},
},
'loggers': {
// ...
'root': {
'handlers': ['sentry'],
'level': 'WARNING',
},
}
}
