]> glassweightruler.freedombox.rocks Git - waydroid.git/blobdiff - tools/helpers/logging.py
logging: Actually enable logfile rotation
[waydroid.git] / tools / helpers / logging.py
index 59627d1635878aecba68bca52620d9403653241e..9f3af64bcb345087041c3c020c3a074adf808c7b 100644 (file)
@@ -71,7 +71,7 @@ def init(args):
     # Add file log handler
     if args.action == "container" and not args.details_to_stdout:
         os.chmod(args.log, 0o644)
-        handler = RotatingFileHandler(args.log, maxBytes=5*1024*1024)
+        handler = RotatingFileHandler(args.log, maxBytes=5*1024*1024, backupCount=1)
         handler.setFormatter(logging.Formatter("(%(process)d) [%(asctime)s] %(message)s",
                                       datefmt="%a, %d %b %Y %H:%M:%S"))
         root_logger.addHandler(handler)