From d431c9cd9d52c318230668f67593aae30b53fdf2 Mon Sep 17 00:00:00 2001 From: Asher Date: Fri, 21 Jun 2024 09:45:23 -0800 Subject: [PATCH] Fix log file path The first argument is a file name, not a path. When the log gets rotated it prepends the date which ends up creating a path in the current working directory. --- src/node/wrapper.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node/wrapper.ts b/src/node/wrapper.ts index 4b84198f3..607512e2c 100644 --- a/src/node/wrapper.ts +++ b/src/node/wrapper.ts @@ -248,9 +248,10 @@ export class ParentProcess extends Process { const opts = { size: "10M", maxFiles: 10, + path: path.join(paths.data, "coder-logs"), } - this.logStdoutStream = rfs.createStream(path.join(paths.data, "coder-logs", "code-server-stdout.log"), opts) - this.logStderrStream = rfs.createStream(path.join(paths.data, "coder-logs", "code-server-stderr.log"), opts) + this.logStdoutStream = rfs.createStream("code-server-stdout.log", opts) + this.logStderrStream = rfs.createStream("code-server-stderr.log", opts) this.onDispose(() => this.disposeChild())