Skip to content

Instantly share code, notes, and snippets.

@lacoski
Forked from alexmorozov/settings.py
Created November 25, 2018 05:15
Show Gist options
  • Save lacoski/1ec6f839a300d4a75c12608cd7ede335 to your computer and use it in GitHub Desktop.
Save lacoski/1ec6f839a300d4a75c12608cd7ede335 to your computer and use it in GitHub Desktop.
Production raven config
INSTALLED_APPS += (
'raven.contrib.django.raven_compat',
)
MIDDLEWARE_CLASSES += (
'raven.contrib.django.raven_compat.middleware.Sentry404CatchMiddleware',
)
RAVEN_CONFIG = {
'dsn': 'http://x:y@sentry.domain.com/2', # NOQA
}
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'root': {
'level': 'WARNING',
'handlers': ['sentry'],
},
'formatters': {
'verbose': {
'format': ('%(levelname)s %(asctime)s %(module)s %(process)d '
'%(thread)d %(message)s')
},
},
'handlers': {
'sentry': {
'level': 'ERROR',
'class': ('raven.contrib.django.raven_compat.handlers.'
'SentryHandler'),
},
},
'loggers': {
'payonline': {
'level': 'ERROR',
'handlers': ['sentry'],
'propagate': False
},
}
logger = logging.getLogger('payonline')
logger.error('PayOnline: {}'.format(u"Connection error"), extra=self._extra_logging_params())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment