From 2179021a4fe4a6aac163bd485ad9b475867ddee9 Mon Sep 17 00:00:00 2001 From: eric Date: Mon, 23 Jul 2018 14:41:46 -0400 Subject: [PATCH] turn on runserver logging --- settings/common.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/settings/common.py b/settings/common.py index 5dd51294..c2e7ae48 100644 --- a/settings/common.py +++ b/settings/common.py @@ -204,11 +204,6 @@ SASS_PROCESSOR_INCLUDE_DIRS = [ ] SASS_PROCESSOR_AUTO_INCLUDE = False -# A sample logging configuration. The only tangible logging -# performed by this configuration is to send an email to -# the site admins on every HTTP 500 error. -# See http://docs.djangoproject.com/en/dev/topics/logging for -# more details on how to customize your logging configuration. LOGGING = { 'version': 1, 'disable_existing_loggers': True, @@ -216,6 +211,10 @@ LOGGING = { 'brief': { 'format': '%(asctime)s %(levelname)s %(name)s[%(funcName)s]: %(message)s', }, + 'django.server': { + '()': 'django.utils.log.ServerFormatter', + 'format': '[%(server_time)s] %(message)s', + }, }, 'filters': { 'require_debug_false': { @@ -236,6 +235,11 @@ LOGGING = { 'backupCount': 5, 'formatter': 'brief', }, + 'django.server': { + 'level': 'INFO', + 'class': 'logging.StreamHandler', + 'formatter': 'django.server', + }, }, 'loggers': { 'django.request': { @@ -243,10 +247,15 @@ LOGGING = { 'level': 'ERROR', 'propagate': True, }, + 'django.server': { + 'handlers': ['django.server'], + 'level': 'INFO', + 'propagate': False, + }, '': { 'handlers': ['file'], 'level': 'INFO', - } + }, } }