diff --git a/conf/logging.json b/conf/logging.json index 4d771421..aa51c601 100644 --- a/conf/logging.json +++ b/conf/logging.json @@ -16,8 +16,7 @@ "file": { "class": "logging.FileHandler", "level": "INFO", - "formatter": "simple", - "filename": "logs/server.log" + "formatter": "simple" } }, "loggers": { diff --git a/src/main.py b/src/main.py index ca88bafb..0bc7dc5c 100644 --- a/src/main.py +++ b/src/main.py @@ -66,6 +66,12 @@ def main(): logging_conf_file = os.path.join(CONFIG_FOLDER, 'logging.json') with open(logging_conf_file, 'rt') as f: log_config = json.load(f) + handlers = log_config.get('handlers') + if handlers: + file_handler = handlers.get('file') + if file_handler: + file_handler['filename'] = os.path.join(LOG_FOLDER, 'server.log') + file_utils.prepare_folder(LOG_FOLDER) logging.config.dictConfig(log_config)