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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
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', }, } } |