Commit 86a541b4 authored by Nicolas Joyard's avatar Nicolas Joyard

Enable logging 404s on sentry

Active when DATA_DIR/sentry.404 exists
parent e5773f79
......@@ -285,6 +285,7 @@ if DEBUG:
logger['handlers'].append('debug')
RAVEN_FILE = os.path.join(DATA_DIR, 'sentry')
RAVEN_404_FILE = os.path.join(DATA_DIR, 'sentry.404')
if os.path.exists(RAVEN_FILE):
INSTALLED_APPS += ('raven.contrib.django.raven_compat',)
......@@ -298,6 +299,13 @@ if os.path.exists(RAVEN_FILE):
'propagate': False,
}
if os.path.exists(RAVEN_404_FILE):
RAVEN_MIDDLEWARE = (
'raven.contrib.django.raven_compat.middleware.Sentry404CatchMiddleware', # noqa
)
MIDDLEWARE_CLASSES = RAVEN_MIDDLEWARE + MIDDLEWARE_CLASSES
with open(RAVEN_FILE, 'r') as f:
RAVEN_CONFIG = {
'dsn': f.read().strip()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment