Add opbeat logging
parent
5cae7503cb
commit
8e546dae71
|
@ -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,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3,4 +3,3 @@
|
|||
|
||||
MySQL-python==1.2.5
|
||||
gunicorn==19.3.0
|
||||
opbeat==3.0.1
|
||||
|
|
Loading…
Reference in New Issue