TimeDrotingFileHandler无法使用dictconfig

2024-10-03 00:24:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我就是这样从配置文件中读取配置的

config.dictConfig(final_config_file)

这是我的配置.json文件。在

^{pr2}$

我正在使用TimeDrotingHandler来随着日期的变化来旋转文件,但不知何故它不起作用,我无法按时间更改文件。我把它定在午夜,但不是工作。任何会得到帮助的。在


Tags: 文件configjson配置文件时间filefinaldictconfig
1条回答
网友
1楼 · 发布于 2024-10-03 00:24:02

将“backupCount”设置为非零。要理解它,请阅读the docs

If backupCount is nonzero, at most backupCount files will be kept, and if more would be created when rollover occurs, the oldest one is deleted. The deletion logic uses the interval to determine which files to delete, so changing the interval may leave old files lying around.

我希望它能帮助你。在

相关问题 更多 >