Merge pull request #2418 from jumpserver/dev

[Update] 修改gunicorn日志
pull/2486/head
老广 6 years ago committed by GitHub
commit 0ac6e6ba2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -191,6 +191,9 @@ LOGGING = {
'simple': { 'simple': {
'format': '%(levelname)s %(message)s' 'format': '%(levelname)s %(message)s'
}, },
'msg': {
'format': '%(message)s'
}
}, },
'handlers': { 'handlers': {
'null': { 'null': {
@ -220,15 +223,20 @@ LOGGING = {
'backupCount': 7, 'backupCount': 7,
'filename': ANSIBLE_LOG_FILE, 'filename': ANSIBLE_LOG_FILE,
}, },
'gunicorn_logs': { 'gunicorn_file': {
'encoding': 'utf8', 'encoding': 'utf8',
'level': 'DEBUG', 'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler', 'class': 'logging.handlers.RotatingFileHandler',
'formatter': 'main', 'formatter': 'msg',
'maxBytes': 1024*1024*100, 'maxBytes': 1024*1024*100,
'backupCount': 2, 'backupCount': 2,
'filename': GUNICORN_LOG_FILE, 'filename': GUNICORN_LOG_FILE,
}, },
'gunicorn_console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'msg'
},
}, },
'loggers': { 'loggers': {
'django': { 'django': {
@ -267,8 +275,8 @@ LOGGING = {
'level': "INFO", 'level': "INFO",
}, },
'gunicorn': { 'gunicorn': {
'handlers': ['console', 'gunicorn_logs'], 'handlers': ['gunicorn_console', 'gunicorn_file'],
'level': LOG_LEVEL, 'level': 'INFO',
}, },
# 'django.db': { # 'django.db': {
# 'handlers': ['console', 'file'], # 'handlers': ['console', 'file'],

Loading…
Cancel
Save