[issue29372] RotatingFileHandler rotates empty logfile if it emits a large string

Vinay Sajip report at bugs.python.org
Wed Jan 25 14:00:51 EST 2017


Vinay Sajip added the comment:

I don't see the point - your proposed solution only works if the log file is completely empty at rollover time, but if the file contains a few bytes from an earlier "short" log message, it might seem just as wasteful of a backup slot as if it had zero bytes. I think the understanding is that maxBytes should be large compared to the size of an average log message, and that if that isn't the case, the user will live with the consequences because it's a contrived scenario (for tests, etc.) rather than a real-life one. There's always the option of subclassing if a user really does need bespoke rollover behaviour.

----------

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


More information about the Python-bugs-list mailing list