diff --git a/dynatrace_extension/sdk/snapshot.py b/dynatrace_extension/sdk/snapshot.py index d963f4d..7c11b30 100644 --- a/dynatrace_extension/sdk/snapshot.py +++ b/dynatrace_extension/sdk/snapshot.py @@ -193,6 +193,8 @@ def find_log_dir() -> Path: for line in f: if line.startswith("LogDir"): log_dir = line.split("=")[1].strip() + if not log_dir: + return Path(os.path.expandvars("%PROGRAMDATA%") + "/dynatrace/oneagent/log") if os.name == "nt" else Path("/var/log/dynatrace/oneagent") return Path(log_dir) msg = f"Could not find LogDir in {installation_conf}" raise Exception(msg)