[docs] [issue29105] code or doc improvement for logging.handlers.RotatingFileHandler

iMath report at bugs.python.org
Thu Dec 29 11:29:54 EST 2016


New submission from iMath:

For 
class logging.handlers.RotatingFileHandler(filename, mode='a', maxBytes=0, backupCount=0, encoding=None, delay=0) 

if backupCount is zero and maxBytes is non-zero, the log file size could exceed maxBytes, i.e. we are not able to restrict the log file size using RotatingFileHandler at this case .
I suggest add the above description to the doc 
https://docs.python.org/3.6/library/logging.handlers.html#logging.handlers.RotatingFileHandler
If possible , set backupCount=1 by default to avoid this pitfall as much as possible.

The doc right now just says "if either of maxBytes or backupCount is zero, rollover never occurs.", it is too difficult to understand the meaning of 'Rollover' to aviod the pitfall .

----------
assignee: docs at python
components: Documentation
messages: 284277
nosy: docs at python, redstone-cold
priority: normal
severity: normal
status: open
title: code or doc improvement for logging.handlers.RotatingFileHandler
type: enhancement
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29105>
_______________________________________


More information about the docs mailing list