From f8a71058f05e5f5afec2e82d705b3da89e41c55b Mon Sep 17 00:00:00 2001 From: KrakatauiHD <35610935+KrakatauiHD@users.noreply.github.com> Date: Thu, 20 Jan 2022 16:08:25 +0100 Subject: [PATCH] make the rotating logsfiles rotating again --- mumbleBot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mumbleBot.py b/mumbleBot.py index 225c078..bf67432 100644 --- a/mumbleBot.py +++ b/mumbleBot.py @@ -730,7 +730,7 @@ def start_web_interface(addr, port): werkzeug_logger = logging.getLogger('werkzeug') logfile = util.solve_filepath(var.config.get('webinterface', 'web_logfile')) if logfile: - handler = logging.handlers.RotatingFileHandler(logfile, mode='a', maxBytes=10240) # Rotate after 10KB + handler = logging.handlers.RotatingFileHandler(logfile, mode='a', maxBytes=10240, backupCount=3) # Rotate after 10KB, leave 3 old logs else: handler = logging.StreamHandler() @@ -813,7 +813,7 @@ if __name__ == '__main__': handler = None if logfile: print(f"Redirecting stdout and stderr to log file: {logfile}") - handler = logging.handlers.RotatingFileHandler(logfile, mode='a', maxBytes=10240) # Rotate after 10KB + handler = logging.handlers.RotatingFileHandler(logfile, mode='a', maxBytes=10240, backupCount=3) # Rotate after 10KB, leave 3 old logs if var.config.getboolean("bot", "redirect_stderr", fallback=False): sys.stderr = util.LoggerIOWrapper(bot_logger, logging.INFO, fallback_io_buffer=sys.stderr.buffer)