PyDocs

Nav

Generic Operating System Services

TimedRotatingFileHandler

  • TimedRotatingFileHandler(filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False, atTime=None, errors=None)
Handler for logging to a file, rotating the log file at certain timed
intervals.

If backupCount is > 0, when rollover is done, no more than backupCount
files are kept - the oldest ones are deleted.
Changed in 3.4, 3.6, 3.9
  • 3.4: atTime parameter was added.
  • 3.6: As well as string values, Path objects are also accepted for the filename argument.
  • 3.9: The errors parameter was added.
Members of TimedRotatingFileHandler

d

doRollover
do a rollover; in this case, a date/time stamp is appended to the filename when the rollover happens.

e

emit
Emit a record.

g

getFilesToDelete
Determine the files to delete when rolling over.

s

shouldRollover
Determine if rollover should occur.
0 Examples
No examples for logging.handlers/TimedRotatingFileHandler.
See Also
No see-alsos for logging.handlers/TimedRotatingFileHandler
0 Notes
No notes for TimedRotatingFileHandler