|
@@ -187,10 +187,10 @@ LOGGING = {
|
|
|
},
|
|
|
'default': {
|
|
|
'level': 'ERROR',
|
|
|
- 'class': 'logging.handlers.RotatingFileHandler',
|
|
|
+ 'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
|
|
|
'filename': BASE_DIR + '/static/log/error/error.log',
|
|
|
'maxBytes': 1024 * 1024 * 5, # 5 MB
|
|
|
- 'backupCount': 5,
|
|
|
+ 'backupCount': 3,
|
|
|
'formatter': 'error_format',
|
|
|
},
|
|
|
'console': {
|
|
@@ -200,48 +200,53 @@ LOGGING = {
|
|
|
},
|
|
|
'info': {
|
|
|
'level': 'INFO',
|
|
|
- 'class': 'logging.handlers.RotatingFileHandler',
|
|
|
+ 'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
|
|
|
'filename': BASE_DIR + '/static/log/info/info.log',
|
|
|
- 'backupCount': 10,
|
|
|
- 'maxBytes': 1024 * 1024 * 2 * 1024, # 2G
|
|
|
+ 'backupCount': 3,
|
|
|
+ 'maxBytes': 1024 * 1024 * 10 * 1024, # 10G
|
|
|
'formatter': 'standard',
|
|
|
'encoding': 'utf-8',
|
|
|
+ 'use_gzip': True, # 启用 Gzip 压缩
|
|
|
},
|
|
|
'time': {
|
|
|
'level': 'INFO',
|
|
|
- 'class': 'logging.handlers.RotatingFileHandler',
|
|
|
+ 'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
|
|
|
'filename': BASE_DIR + '/static/log/time/info.log',
|
|
|
- 'backupCount': 10,
|
|
|
- 'maxBytes': 1024 * 1024 * 2 * 1024, # 2G
|
|
|
+ 'backupCount': 3,
|
|
|
+ 'maxBytes': 1024 * 1024 * 10 * 1024, # 10G
|
|
|
'formatter': 'standard',
|
|
|
'encoding': 'utf-8',
|
|
|
+ 'use_gzip': True, # 启用 Gzip 压缩
|
|
|
},
|
|
|
'v1_push': {
|
|
|
'level': 'INFO',
|
|
|
- 'class': 'logging.handlers.RotatingFileHandler',
|
|
|
+ 'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
|
|
|
'filename': BASE_DIR + '/static/log/v1log/info.log',
|
|
|
- 'backupCount': 10,
|
|
|
- 'maxBytes': 1024 * 1024 * 2 * 1024, # 2G
|
|
|
+ 'backupCount': 3,
|
|
|
+ 'maxBytes': 1024 * 1024 * 10 * 1024, # 10G
|
|
|
'formatter': 'standard',
|
|
|
'encoding': 'utf-8',
|
|
|
+ 'use_gzip': True, # 启用 Gzip 压缩
|
|
|
},
|
|
|
'customized_push': {
|
|
|
'level': 'INFO',
|
|
|
- 'class': 'logging.handlers.RotatingFileHandler',
|
|
|
+ 'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
|
|
|
'filename': BASE_DIR + '/static/log/customized_push/info.log',
|
|
|
- 'backupCount': 10,
|
|
|
+ 'backupCount': 3,
|
|
|
'maxBytes': 1024 * 1024 * 2 * 100, # 100M
|
|
|
'formatter': 'standard',
|
|
|
'encoding': 'utf-8',
|
|
|
+ 'use_gzip': True, # 启用 Gzip 压缩
|
|
|
},
|
|
|
'error_info': {
|
|
|
'level': 'INFO',
|
|
|
- 'class': 'logging.handlers.RotatingFileHandler',
|
|
|
+ 'class': 'concurrent_log_handler.ConcurrentRotatingFileHandler',
|
|
|
'filename': BASE_DIR + '/static/log/error_info/info.log',
|
|
|
- 'backupCount': 10,
|
|
|
+ 'backupCount': 3,
|
|
|
'maxBytes': 1024 * 1024 * 2 * 100, # 100M
|
|
|
'formatter': 'standard',
|
|
|
'encoding': 'utf-8',
|
|
|
+ 'use_gzip': True, # 启用 Gzip 压缩
|
|
|
},
|
|
|
},
|
|
|
'loggers': {
|