1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-26 00:38:10 +00:00

Fix minor bugs with log rotation support. Ref #1586

This commit is contained in:
grossmj 2019-05-28 10:34:27 +07:00
parent 5cbfafbeb2
commit 591d4f29ff
2 changed files with 2 additions and 2 deletions

View File

@ -127,7 +127,7 @@ def parse_arguments(argv):
"quiet": config.getboolean("quiet", False), "quiet": config.getboolean("quiet", False),
"debug": config.getboolean("debug", False), "debug": config.getboolean("debug", False),
"logfile": config.getboolean("logfile", ""), "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), "logbackupcount": config.get("logbackupcount", 10),
"logcompression": config.getboolean("logcompression", False) "logcompression": config.getboolean("logcompression", False)
} }

View File

@ -138,7 +138,7 @@ class CompressedRotatingFileHandler(RotatingFileHandler):
self.stream = self._open() 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 logfile and len(logfile) > 0:
if compression: if compression:
stream_handler = CompressedRotatingFileHandler(logfile, maxBytes=max_bytes, backupCount=backup_count) stream_handler = CompressedRotatingFileHandler(logfile, maxBytes=max_bytes, backupCount=backup_count)