Commit 225d50d1 authored by Mathieu Courcelles's avatar Mathieu Courcelles

Adds Sentry

parent f0e3a902
...@@ -80,11 +80,17 @@ LOGGING = { ...@@ -80,11 +80,17 @@ LOGGING = {
'level': 'ERROR', 'level': 'ERROR',
'filters': ['require_debug_false'], 'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler' 'class': 'django.utils.log.AdminEmailHandler'
} },
'sentry': {
'level': 'ERROR',
'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
'tags': {'custom-tag': 'x'},
},
}, },
'loggers': { 'loggers': {
'django': { 'django': {
'handlers': ['console'], 'handlers': ['console', 'sentry'],
'level': 'INFO', 'level': 'INFO',
}, },
'django.request': { 'django.request': {
...@@ -191,6 +197,8 @@ INSTALLED_APPS = ( ...@@ -191,6 +197,8 @@ INSTALLED_APPS = (
# Visual enhancment # Visual enhancment
'grappelli.dashboard', 'grappelli.dashboard',
'grappelli', 'grappelli',
'raven.contrib.django.raven_compat',
# Uncomment the next line to enable the admin: # Uncomment the next line to enable the admin:
'django.contrib.admin', 'django.contrib.admin',
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
# Import Django related libraries # Import Django related libraries
# Third party libraries
import raven
# Import project libraries # Import project libraries
from .base import * from .base import *
from ..secrets import get_secret from ..secrets import get_secret
...@@ -59,3 +62,18 @@ DATABASES = { ...@@ -59,3 +62,18 @@ DATABASES = {
TIME_ZONE = 'America/Montreal' TIME_ZONE = 'America/Montreal'
PERCOLATOR_BIN = r'/usr/bin/percolator' PERCOLATOR_BIN = r'/usr/bin/percolator'
if os.getenv('SENTRY', None):
RAVEN_CONFIG = {
'dsn': get_secret('SENTRY'),
# If you are using git, you can also automatically configure the
# release based on the git info.
'release': os.getenv('GIT_SHA'),
}
# 404 logging
MIDDLEWARE_CLASSES.insert(0, 'raven.contrib.django.raven_compat.middleware.Sentry404CatchMiddleware')
MIDDLEWARE_CLASSES.insert(0, 'x_forwarded_for.middleware.XForwardedForMiddleware')
...@@ -7,4 +7,5 @@ biopython==1.64 ...@@ -7,4 +7,5 @@ biopython==1.64
numpy==1.9.1 numpy==1.9.1
scipy==0.16.0 scipy==0.16.0
pytz==2014.7 pytz==2014.7
gunicorn==19.6.0 gunicorn==19.6.0
\ No newline at end of file raven==6.3.0
\ No newline at end of file
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