From 591d4f29ff651aab8cee556f0f04d66e0b8d9193 Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 28 May 2019 10:34:27 +0700 Subject: [PATCH] Fix minor bugs with log rotation support. Ref #1586 --- gns3server/run.py | 2 +- gns3server/web/logger.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/run.py b/gns3server/run.py index d4c875e7..e864b787 100644 --- a/gns3server/run.py +++ b/gns3server/run.py @@ -127,7 +127,7 @@ def parse_arguments(argv): "quiet": config.getboolean("quiet", False), "debug": config.getboolean("debug", False), "logfile": config.getboolean("logfile", ""), - "logmaxsize": config.get("logfile", 10000000), # default is 10MB + "logmaxsize": config.get("logmaxsize", 10000000), # default is 10MB "logbackupcount": config.get("logbackupcount", 10), "logcompression": config.getboolean("logcompression", False) } diff --git a/gns3server/web/logger.py b/gns3server/web/logger.py index 1f9b65bb..64f4c043 100644 --- a/gns3server/web/logger.py +++ b/gns3server/web/logger.py @@ -138,7 +138,7 @@ class CompressedRotatingFileHandler(RotatingFileHandler): self.stream = self._open() -def init_logger(level, logfile=None, max_bytes=1000000000, backup_count=10, compression=True, quiet=False): +def init_logger(level, logfile=None, max_bytes=10000000, backup_count=10, compression=True, quiet=False): if logfile and len(logfile) > 0: if compression: stream_handler = CompressedRotatingFileHandler(logfile, maxBytes=max_bytes, backupCount=backup_count)