feat: 设置单个文件日志大小上限为2m
This commit is contained in:
parent
9f8cf21bf1
commit
27fa035bea
|
@ -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', # 设置默认编码
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue