diff --git a/lazyllm/common/logger.py b/lazyllm/common/logger.py index 9f951f46..0985dcd2 100644 --- a/lazyllm/common/logger.py +++ b/lazyllm/common/logger.py @@ -34,6 +34,7 @@ class _Log: def __init__(self): self._name = lazyllm.config["log_name"] self._pid = getpid() + self._log_dir_path = check_path(lazyllm.config["log_dir"], exist=False, file=False) if getenv("LOGURU_AUTOINIT", "true").lower() in ("1", "true") and stderr: try: @@ -101,9 +102,8 @@ def __getattr__(self, attr): def add_file_sink(): name = lazyllm.config["log_name"] pid = getpid() - log_dir_path = lazyllm.config["log_dir"] + log_dir_path = LOG._log_dir_path if log_dir_path: - log_dir_path = check_path(log_dir_path, exist=False, file=False) log_file_mode = lazyllm.config["log_file_mode"] if log_file_mode == "merge": log_file_name = f"{name}.json.log"