Commit bdd01530 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

include error traceback attachement in admin error emails

parent 5cd8516f
...@@ -206,6 +206,7 @@ else: ...@@ -206,6 +206,7 @@ else:
CACHES = { CACHES = {
'default': { 'default': {
'BACKEND': 'redis_cache.RedisCache', 'BACKEND': 'redis_cache.RedisCache',
# configure to redis port
'LOCATION': '/var/run/redis/redis.sock', 'LOCATION': '/var/run/redis/redis.sock',
}, },
} }
...@@ -232,12 +233,20 @@ if not DEBUG: ...@@ -232,12 +233,20 @@ if not DEBUG:
'disable_existing_loggers': False, 'disable_existing_loggers': False,
'handlers': { 'handlers': {
'file': { 'file': {
'level': 'DEBUG', 'level': 'DEBUG', # will log all errors
'class': 'logging.FileHandler', 'class': 'logging.FileHandler',
# make sure to change this to the proper path, and one that # make sure to change this to the proper path, and one that
# can be written to # can be written to
'filename': '/path/to/django/debug.log', 'filename': '/path/to/django/debug.log',
}, },
# 'mail_admins' by default does not include a traceback attachment
# setting 'include_html' to True will attach an html traceback file to the email
# you can also set an addtional 'email_backend' arg to a custom email handler (e.g. SES)
'mail_admins': {
'level': 'ERROR',
'class': 'django.util.log.AdminEmailHandler',
'include_html': True,
},
}, },
# logs request errors # logs request errors
'loggers': { 'loggers': {
...@@ -246,5 +255,7 @@ if not DEBUG: ...@@ -246,5 +255,7 @@ if not DEBUG:
'level': 'DEBUG', 'level': 'DEBUG',
'propagate': True, 'propagate': True,
}, },
# django's default loggers send request and security messages at the ERROR
# or CRITICAL level to the AdminEmailHandler via mail_admins
}, },
} }
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