settings: add sentry support

This commit is contained in:
Benjamin Dauvergne 2013-11-06 11:58:22 +01:00
parent 6b281270d0
commit 667fe6159e
4 changed files with 14 additions and 5 deletions

View File

@ -195,6 +195,7 @@ All settings must be donne in the file ``/etc/docbow/local_settings.py``. Availa
* ``DOCBOW_ORGANIZATION``: an unicode string giving a description of the
organization providing the platform. It's used as a signature in mail and
sms notifications.
* ``RAVEN_CONFIG_DSN``: the URL of the sentry project for gathering exceptions.
Customizing templates
---------------------

View File

@ -78,6 +78,7 @@ __ENVIRONMENT_DEFAULTS = dict(
DATE_INPUT_FORMATS=('%d/%m/%Y', '%Y-%m-%d'),
CRISPY_TEMPLATE_PACK='uni_form',
DOCBOW_TIMESTAMP_PROVIDER='certum',
RAVEN_CONFIG_DSN='',
)
for key, default in __ENVIRONMENT_DEFAULTS.iteritems():
@ -176,7 +177,7 @@ LOGGING = {
'handlers': {
'syslog': {
'level': 'DEBUG',
'class': 'entrouvert.logging.handlers.SysLogHandler',
'class': 'entrouvert.logging.handlers.SysLogHandler',
'formatter': 'syslog_debug' if DEBUG else 'syslog',
'facility': logging.handlers.SysLogHandler.LOG_LOCAL0,
'address': '/dev/log',
@ -194,6 +195,11 @@ LOGGING = {
'formatter': 'syslog_debug',
'level': 'DEBUG',
},
'sentry': {
'level': 'ERROR',
'class': 'raven.handlers.logging.SentryHandler',
'dsn': RAVEN_CONFIG_DSN,
},
},
'loggers': {
'django.db': {
@ -207,22 +213,22 @@ LOGGING = {
'propagate': False,
},
'south': {
'handlers': [ 'mail_admins', 'syslog' ],
'handlers': [ 'sentry', 'syslog' ],
'level': 'INFO',
'propagate': False,
},
'docbow.mail_interface': {
'handlers': [ 'mail_admins', 'syslog' ],
'handlers': [ 'sentry', 'syslog' ],
'level': 'DEBUG' if DEBUG else 'INFO',
'propagate': False,
},
'docbow': {
'handlers': [ 'mail_admins', 'syslog' ],
'handlers': [ 'sentry', 'syslog' ],
'level': 'DEBUG' if DEBUG else 'INFO',
'propagate': False,
},
'': {
'handlers': [ 'mail_admins', 'syslog' ],
'handlers': [ 'sentry', 'syslog' ],
'level': 'DEBUG',
},
},

View File

@ -16,3 +16,4 @@ django-picklefield==0.3.0
git+http://repos.entrouvert.org/python-entrouvert.git/#egg=python-entrouvert-1.1.9999
django-tables2==0.13.0
python-magic<0.5
raven

View File

@ -114,6 +114,7 @@ setup(name='docbow',
'django-picklefield==0.3.0',
'python-entrouvert<2.0',
'django-tables2==0.13.0',
'raven',
],
setup_requires=[
'Django>=1.5,<1.6',