1
0
Fork 0

Add opbeat logging

merge-requests/26/head
Nikos Roussos 2015-07-17 20:22:07 +03:00
parent 5cae7503cb
commit 8e546dae71
3 changed files with 31 additions and 7 deletions

View File

@ -1,7 +1,6 @@
from os import path, getenv
BASE_DIR = path.dirname(path.dirname(__file__))
# Apps
DJANGO_APPS = (
'django.contrib.auth',
@ -116,24 +115,49 @@ LOGIN_REDIRECT_URL = 'home'
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s: [%(asctime)s] %(module)s - %(process)d %(thread)d - %(message)s'
},
},
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose'
},
'opbeat': {
'level': 'WARNING',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
'class': 'opbeat.contrib.django.handlers.OpbeatHandler',
},
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'handlers': ['opbeat'],
'level': 'ERROR',
'propagate': True,
},
'django.db.backends': {
'level': 'ERROR',
'handlers': ['opbeat'],
'propagate': False,
},
'db': {
'level': 'WARNING',
'handlers': ['opbeat'],
'propagate': False,
},
'opbeat.errors': {
'level': 'ERROR',
'handlers': ['console'],
'propagate': False,
},
}
}

View File

@ -5,6 +5,7 @@ django-shortuuidfield==0.1.2
# Configuration
django_dotenv==1.3.0
dj-database-url==0.3.0
opbeat==3.0.1
# Security
django-braces==1.4.0

View File

@ -3,4 +3,3 @@
MySQL-python==1.2.5
gunicorn==19.3.0
opbeat==3.0.1