Why doesn't my TimedRotatingFileHandler rotate at midnight?

后端 未结 3 1389
醉梦人生
醉梦人生 2021-01-02 09:24

This is my config file:

[loggers]
keys=root

[handlers]
keys=TimedRotatingFileHandler

[formatters]
keys=simpleFormatter

[logger_root]
level=DEBUG
handlers=         


        
3条回答
  •  盖世英雄少女心
    2021-01-02 09:51

    I would guess this really only happens when the process is running at midnight. In your case (cronjob not running very long), you should go with a simple log file, where the current date is added to the logfilename. This way, a "rollover" happens automatically.

提交回复
热议问题