From 3efb2f8790a698c2f4e7bd7593b569089610b552 Mon Sep 17 00:00:00 2001 From: Nico Zanferrari Date: Wed, 24 Jul 2024 17:59:34 +0200 Subject: [PATCH] Fix errorlog file variable --- py4web/utils/logsetting.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/py4web/utils/logsetting.py b/py4web/utils/logsetting.py index 718654b3..0eed0ddb 100644 --- a/py4web/utils/logsetting.py +++ b/py4web/utils/logsetting.py @@ -2,9 +2,12 @@ def get_log_file(out_banner=True): - log_dir = os.environ.get("PY4WEB_LOGS", None) - if log_dir and os.path.isdir(log_dir): - log_file = os.path.join(log_dir, "server-py4web.log") + log_dir = os.environ.get("PY4WEB_ERRORLOG", None) + if log_dir: + if os.path.isdir(log_dir): + log_file = os.path.join(log_dir, "server-py4web.log") + else: + log_file = log_dir if out_banner: print(f"log_file: {log_file}") return log_file