feat: 设置单个文件日志大小上限为2m

This commit is contained in:
caoqianming 2023-07-25 11:19:13 +08:00
parent 9f8cf21bf1
commit 27fa035bea
1 changed files with 6 additions and 6 deletions

View File

@ -338,8 +338,8 @@ LOGGING = {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_PATH, 'all-{}.log'.format(datetime.now().strftime('%Y-%m-%d'))),
'maxBytes': 1024 * 1024 * 5, # 文件大小
'backupCount': 5, # 备份数
'maxBytes': 1024 * 1024 * 2, # 文件大小
'backupCount': 10, # 备份数
'formatter': 'standard', # 输出格式
'encoding': 'utf-8', # 设置默认编码,否则打印出来汉字乱码
},
@ -348,8 +348,8 @@ LOGGING = {
'level': 'ERROR',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_PATH, 'error-{}.log'.format(datetime.now().strftime('%Y-%m-%d'))),
'maxBytes': 1024 * 1024 * 5, # 文件大小
'backupCount': 5, # 备份数
'maxBytes': 1024 * 1024 * 2, # 文件大小
'backupCount': 10, # 备份数
'formatter': 'standard', # 输出格式
'encoding': 'utf-8', # 设置默认编码
},
@ -365,8 +365,8 @@ LOGGING = {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(LOG_PATH, 'info-{}.log'.format(datetime.now().strftime('%Y-%m-%d'))),
'maxBytes': 1024 * 1024 * 5,
'backupCount': 5,
'maxBytes': 1024 * 1024 * 2,
'backupCount': 10,
'formatter': 'standard',
'encoding': 'utf-8', # 设置默认编码
},