[issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified
Alexander Smirnov
report at bugs.python.org
Tue Jul 27 18:37:55 EDT 2021
New submission from Alexander Smirnov <alexander.smirnoff at gmail.com>:
after adding namer callable (like it is described in https://bugs.python.org/issue43344) to log handler configuration, it stopped removing old files
log_filename = os.path.join(log_dir, "application.log")
log_handler = logging.handlers.TimedRotatingFileHandler(log_filename, when='MIDNIGHT', interval=1, backupCount=7)
// after adding this line, old files are not deleted
log_handler.namer = lambda name: name.replace(".log", "") + ".log"
----------
components: Library (Lib)
messages: 398326
nosy: alexander.smirnoff
priority: normal
severity: normal
status: open
title: backupCount is not respected in TimedRotatingFileHandler when namer is specified
versions: Python 3.8
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44753>
_______________________________________
More information about the Python-bugs-list
mailing list