I try to limit the size of log file in Python, using RotatingFileHandler.
I am using the following code:
logger = logging.getLogger(logging.basicConfig(
filename = log_filename,
handlers = [logging.handlers.RotatingFileHandler(filename=log_filename, maxBytes=1024, backupCount=20)],
format = "%(asctime)s %(message)s",
level = logging.DEBUG))
I visited here and here. I am using both maxBytes and backupCount parameters, but it is still not working. Any idea why the log file is not rotating?