Commit 49183fb6 authored by Nikolai R Kristiansen's avatar Nikolai R Kristiansen
Browse files

Add sentry

parent cf6b1ad1
import os
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
import raven
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
......@@ -77,7 +78,7 @@ INSTALLED_APPS = (
'rest_framework',
'rest_framework.authtoken',
'django_extensions',
'raven.contrib.django.raven_compat',
'mdb',
)
......@@ -87,6 +88,50 @@ TEMPLATE_CONTEXT_PROCESSORS = TCP + (
'django.core.context_processors.request', # for django-suit
)
# Logging
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s '
'%(process)d %(thread)d %(message)s'
},
},
'handlers': {
'sentry': {
'level': 'WARNING', # To capture more than ERROR, change to WARNING, INFO, etc.
'class': 'raven.contrib.django.raven_compat.handlers.SentryHandler',
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose'
}
},
'loggers': {
'root': {
'level': 'WARNING',
'handlers': ['sentry'],
},
'django.db.backends': {
'level': 'ERROR',
'handlers': ['console'],
'propagate': False,
},
'raven': {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': False,
},
'sentry.errors': {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': False,
},
},
}
# django-suit configuration
SUIT_CONFIG = {
# header
......@@ -118,16 +163,25 @@ SUIT_CONFIG = {
# misc
'LIST_PER_PAGE': 35
}
# REST Framework
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAuthenticated',),
'PAGINATE_BY': 10
}
# PXE
MDB_PXE_TFTP_ROOT = '/var/lib/tftpboot/pxelinux/pxelinux.cfg/'
MDB_PXE_KERNEL = 'ubuntu/14_04/amd64/alternate/linux'
MDB_PXE_INITRD = 'ubuntu/14_04/amd64/alternate/initrd.gz'
MDB_PXE_PRESEED_URL = 'http://158.36.190.194/ubuntu/preseed_1404.cfg'
# Sentry
RAVEN_CONFIG = {
'dsn': os.getenv('RAVEN_DSN'),
'release': raven.fetch_git_sha(BASE_DIR)
}
try:
from .local_settings import *
except ImportError:
......
......@@ -5,4 +5,5 @@ djangorestframework==3.5.3
django-suit==0.2.23
gunicorn==19.6.0
ipaddress==1.0.17
mysqlclient==1.3.9
\ No newline at end of file
mysqlclient==1.3.9
raven==5.32.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