We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d35f2bb commit f07b621Copy full SHA for f07b621
conf/logging.json
@@ -16,8 +16,7 @@
16
"file": {
17
"class": "logging.FileHandler",
18
"level": "INFO",
19
- "formatter": "simple",
20
- "filename": "logs/server.log"
+ "formatter": "simple"
21
}
22
},
23
"loggers": {
src/main.py
@@ -66,6 +66,12 @@ def main():
66
logging_conf_file = os.path.join(CONFIG_FOLDER, 'logging.json')
67
with open(logging_conf_file, 'rt') as f:
68
log_config = json.load(f)
69
+ handlers = log_config.get('handlers')
70
+ if handlers:
71
+ file_handler = handlers.get('file')
72
+ if file_handler:
73
+ file_handler['filename'] = os.path.join(LOG_FOLDER, 'server.log')
74
+
75
file_utils.prepare_folder(LOG_FOLDER)
76
77
logging.config.dictConfig(log_config)
0 commit comments