#2510: cleaning up logs and add logging handler clearing to prevent duplicate logs

This commit is contained in:
Czar Echavez
2024-04-23 11:54:34 +01:00
parent 56d03aaf7b
commit c13b7d7c81
6 changed files with 2 additions and 4 deletions

View File

@@ -97,7 +97,6 @@ class SoftwareManager:
software.software_manager = self
self.software[software.name] = software
self.port_protocol_mapping[(software.port, software.protocol)] = software
self.sys_log.info(f"Installed {software.name}")
if isinstance(software, Application):
software.operating_state = ApplicationOperatingState.CLOSED

View File

@@ -52,6 +52,7 @@ class SysLog:
file_handler.setFormatter(logging.Formatter(log_format))
self.logger = logging.getLogger(f"{self.hostname}_sys_log")
self.logger.handlers.clear() # clear handlers
self.logger.setLevel(logging.DEBUG)
self.logger.addHandler(file_handler)