From 77259f07f506e3208cd4500e1e3890e1d95914d6 Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Thu, 22 Sep 2022 16:27:44 -0400 Subject: [PATCH] Make sure we always have a good path. The path wasn't right when running tests, because our working directory wasn't /spiffworkflow-backend --- src/spiffworkflow_backend/services/logging_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spiffworkflow_backend/services/logging_service.py b/src/spiffworkflow_backend/services/logging_service.py index 93c5ed6b..fa6967d0 100644 --- a/src/spiffworkflow_backend/services/logging_service.py +++ b/src/spiffworkflow_backend/services/logging_service.py @@ -132,7 +132,7 @@ def setup_logger(app: Flask) -> None: spiff_logger_filehandler = None if app.config["SPIFFWORKFLOW_BACKEND_LOG_TO_FILE"]: - spiff_logger_filehandler = logging.FileHandler(f"log/{app.env}.log") + spiff_logger_filehandler = logging.FileHandler(f"{app.root_path}/../../log/{app.env}.log") spiff_logger_filehandler.setLevel(spiff_log_level) spiff_logger_filehandler.setFormatter(log_formatter)