diff --git a/packages/nodejs/.changesets/fix-diagnose-log_dir_path-path.md b/packages/nodejs/.changesets/fix-diagnose-log_dir_path-path.md new file mode 100644 index 00000000..ea85598c --- /dev/null +++ b/packages/nodejs/.changesets/fix-diagnose-log_dir_path-path.md @@ -0,0 +1,5 @@ +--- +bump: "patch" +--- + +Fix the diagnose's `log_dir_path` path check. It now always checks the actual log file's parent directory, rather than the configured path. These two values may differ as the package does a permission check to see if the `logPath` is writable or not. diff --git a/packages/nodejs/src/diagnose.ts b/packages/nodejs/src/diagnose.ts index 4ad014b1..1b5327ef 100644 --- a/packages/nodejs/src/diagnose.ts +++ b/packages/nodejs/src/diagnose.ts @@ -148,7 +148,7 @@ export class DiagnoseTool { path: process.cwd() }, log_dir_path: { - path: this.#config.data.logPath!.replace("/appsignal.log", "") + path: path.dirname(logFilePath) }, "appsignal.log": { path: logFilePath,