码迷,mamicode.com
首页 > 其他好文 > 详细

django TimedRotatingFileHandler log

时间:2018-07-27 17:02:10      阅读:261      评论:0      收藏:0      [点我收藏+]

标签:util   eve   can   hand   file   href   http   instance   link   

15.9.6. TimedRotatingFileHandler

The TimedRotatingFileHandler class, located in the logging.handlers module, supports rotation of disk log files at certain timed intervals.

class logging.handlers.TimedRotatingFileHandler(filenamewhen=‘h‘interval=1backupCount=0encoding=Nonedelay=Falseutc=False)

Returns a new instance of the TimedRotatingFileHandler class. The specified file is opened and used as the stream for logging. On rotating it also sets the filename suffix. Rotating happens based on the product of when and interval.

You can use the when to specify the type of interval. The list of possible values is below. Note that they are not case sensitive.

  
ValueType of interval
‘S‘ Seconds
‘M‘ Minutes
‘H‘ Hours
‘D‘ Days
‘W0‘-‘W6‘ Weekday (0=Monday)
‘midnight‘ Roll over at midnight

django TimedRotatingFileHandler log

标签:util   eve   can   hand   file   href   http   instance   link   

原文地址:https://www.cnblogs.com/ExMan/p/9378369.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!