首页 > 其他 > 详细

django TimedRotatingFileHandler log

时间:2018-07-27 16:41:28      阅读:378      评论:0      收藏:0      [点我收藏+]

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!