0

I have a heroku backend with all errors being recorded in sentry. However, any exceptions are not being recorded

Is there a way to get Exceptions recorded in sentry as well?

Here is my typical Sentry screen: http://gyazo.com/3f14899e0a2fb2fb758ba22ae180cf26

My settings is here:

# sentry config
# Set your DSN value
RAVEN_CONFIG = {
    'dsn': 'https://ba3cf8050acb4e9b977fde27f30c0bb2:b59c09b7cb0a4b07ae75b08debc3eb24@app.getsentry.com/35850',
}

LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
    'root': {
        'level': 'WARNING',
        'handlers': ['console'],
    },
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
        'standard': {
            'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
        },
    },
    'handlers': {
        'sentry': {
            'level': 'WARNING',
            'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
        },
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'verbose'
        }
    },
    'loggers': {
        'django.db.backends': {
            'level': 'WARNING',
            'handlers': ['console'],
            'propagate': True,
        },
        'django.request': {
            'level': 'DEBUG',
            'handlers': ['console'],
            'propagate': True,
        },
        'raven': {
            'level': 'DEBUG',
            'handlers': ['console'],
            'propagate': False,
        },
        'sentry.errors': {
            'level': 'DEBUG',
            'handlers': ['console', 'sentry'],
            'propagate': False,
        },
        'celery': {
            'level': 'WARNING',
            'handlers': ['sentry', 'console'],
            'propagate': True,
        },
    },
}

# enable 404 logging
MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
  'raven.contrib.django.raven_compat.middleware.Sentry404CatchMiddleware',
)
dowjones123
  • 3,695
  • 5
  • 40
  • 83

1 Answers1

0

Have you added raven to the INSTALLED_APPS in the settings.py file?

This causes Raven to install a hook in Django that will automatically report uncaught exceptions.

INSTALLED_APPS = (
# ...
    'raven.contrib.django.raven_compat',
)

If you have another middleware that handles errors and exceptions, you've got to make sure that they're still sending to the Sentry server by adding a custom middleware.

Igor Hatarist
  • 5,234
  • 2
  • 32
  • 45