diff --git a/sigi/settings/base.py b/sigi/settings/base.py index ca3f2d9..94cc423 100644 --- a/sigi/settings/base.py +++ b/sigi/settings/base.py @@ -144,3 +144,33 @@ THUMBNAIL_ALIASES = { } IMAGE_CROPPING_SIZE_WARNING = True IMAGE_CROPPING_THUMB_SIZE = (800, 600) + +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'filters': { + 'require_debug_false': { + '()': 'django.utils.log.RequireDebugFalse' + } + }, + 'handlers': { + 'mail_admins': { + 'level': 'ERROR', + 'class': 'django.utils.log.AdminEmailHandler', + 'include_html': True, + 'filters': ['require_debug_false'], + }, + 'file': { + 'level': 'DEBUG', + 'class': 'logging.FileHandler', + 'filename': '/var/log/sigi/application.log', + }, + }, + 'loggers': { + 'django.request': { + 'handlers': ['mail_admins', 'file'], + 'level': 'ERROR', + 'propagate': True, + }, + }, +}