调整日志文件文件为每小时生成一个

This commit is contained in:
ngfchl
2022-12-05 10:46:28 +08:00
parent 91cce300d8
commit 247c8901b2

View File

@@ -187,7 +187,8 @@ LOGGING = {
# 新增内容
'class': 'logging.handlers.TimedRotatingFileHandler',
'filename': os.path.join(BASE_DIR, 'db/logs.log'),
'when': 'midnight',
'when': 'h',
'interval': 1,
'backupCount': 30,
# 'class': 'logging.handlers.RotatingFileHandler',
# 'filename': "db/{}.log".format(datetime.datetime.today()), # 日志文件的位置