TimedRotatingFileHandler Changing File Name?

前端 未结 5 1590
臣服心动
臣服心动 2020-12-04 22:48

I am trying to implement the python logging handler TimedRotatingFileHandler.

When it rolls over to midnight it appends the current day in the form

5条回答
  •  抹茶落季
    2020-12-04 23:13

    Thanks.

    I looked at the source.

    There isn't really a way to change its form. Since manipulating suffix, only appends to the end of the file name. Ether way, there is no way real way to manipulate the full file name, what i was hoping for was where you can declare a file mask, and when it does the "RollOver" it will create a new file name based on the file mask. I am just going to go back to my original idea, was to just kill the whole logging subsystem and reinitialize it with the new file name when it RollsOver.

    Thanks Tho.

提交回复
热议问题