From 785cc04126388c7eabc64ab317019993045854b2 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 20 Feb 2019 16:11:58 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9gunicorn=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/jumpserver/settings.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/jumpserver/settings.py b/apps/jumpserver/settings.py index 93d977149..40f757d39 100644 --- a/apps/jumpserver/settings.py +++ b/apps/jumpserver/settings.py @@ -191,6 +191,9 @@ LOGGING = { 'simple': { 'format': '%(levelname)s %(message)s' }, + 'msg': { + 'format': '%(message)s' + } }, 'handlers': { 'null': { @@ -220,15 +223,20 @@ LOGGING = { 'backupCount': 7, 'filename': ANSIBLE_LOG_FILE, }, - 'gunicorn_logs': { + 'gunicorn_file': { 'encoding': 'utf8', 'level': 'DEBUG', 'class': 'logging.handlers.RotatingFileHandler', - 'formatter': 'main', + 'formatter': 'msg', 'maxBytes': 1024*1024*100, 'backupCount': 2, 'filename': GUNICORN_LOG_FILE, }, + 'gunicorn_console': { + 'level': 'DEBUG', + 'class': 'logging.StreamHandler', + 'formatter': 'msg' + }, }, 'loggers': { 'django': { @@ -267,8 +275,8 @@ LOGGING = { 'level': "INFO", }, 'gunicorn': { - 'handlers': ['console', 'gunicorn_logs'], - 'level': LOG_LEVEL, + 'handlers': ['gunicorn_console', 'gunicorn_file'], + 'level': 'INFO', }, # 'django.db': { # 'handlers': ['console', 'file'],