From 92cdea62ed993acd8a6c3c2798c6b89143c3cfb5 Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Thu, 24 Nov 2011 19:26:27 +0530 Subject: Configuring logging to be a tad more useful. --- settings.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index c007867..a844324 100644 --- a/settings.py +++ b/settings.py @@ -155,7 +155,20 @@ INSTALLED_APPS = ( LOGGING = { 'version': 1, 'disable_existing_loggers': False, + 'formatters': { + 'verbose': { + 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s' + }, + 'simple': { + 'format': '%(levelname)s %(message)s' + }, + }, 'handlers': { + 'console':{ + 'level':'DEBUG', + 'class':'logging.StreamHandler', + 'formatter': 'simple' + }, 'mail_admins': { 'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler' @@ -163,7 +176,7 @@ LOGGING = { }, 'loggers': { 'django.request': { - 'handlers': ['mail_admins'], + 'handlers': ['mail_admins', 'console'], 'level': 'ERROR', 'propagate': True, }, -- cgit