diff --git a/project/src/utils/logging/AbstractWinstonLogger.ts b/project/src/utils/logging/AbstractWinstonLogger.ts index 2d81edf1..db06ea12 100644 --- a/project/src/utils/logging/AbstractWinstonLogger.ts +++ b/project/src/utils/logging/AbstractWinstonLogger.ts @@ -1,3 +1,4 @@ +import path from "node:path"; import crypto from "node:crypto"; import fs from "node:fs"; import { promisify } from "node:util"; @@ -34,7 +35,7 @@ export abstract class AbstractWinstonLogger implements ILogger { protected writeFilePromisify: (path: fs.PathLike, data: string, options?: any) => Promise; constructor(protected asyncQueue: IAsyncQueue) { - this.filePath = `${this.getFilePath()}${this.getFileName()}`; + this.filePath = path.join(this.getFilePath(), this.getFileName()); this.writeFilePromisify = promisify(fs.writeFile); this.showDebugInConsole = globalThis.G_DEBUG_CONFIGURATION; if (!fs.existsSync(this.getFilePath())) { diff --git a/project/src/utils/logging/WinstonMainLogger.ts b/project/src/utils/logging/WinstonMainLogger.ts index 091ac67d..1f59bfc6 100644 --- a/project/src/utils/logging/WinstonMainLogger.ts +++ b/project/src/utils/logging/WinstonMainLogger.ts @@ -1,3 +1,4 @@ +import path from "node:path"; import { IAsyncQueue } from "@spt/models/spt/utils/IAsyncQueue"; import { AbstractWinstonLogger } from "@spt/utils/logging/AbstractWinstonLogger"; import { inject, injectable } from "tsyringe"; @@ -21,7 +22,7 @@ export class WinstonMainLogger extends AbstractWinstonLogger { } protected getFilePath(): string { - return "./user/logs/"; + return path.join("user" ,"logs"); } protected getFileName(): string { diff --git a/project/src/utils/logging/WinstonRequestLogger.ts b/project/src/utils/logging/WinstonRequestLogger.ts index fa4472e4..526b61a6 100644 --- a/project/src/utils/logging/WinstonRequestLogger.ts +++ b/project/src/utils/logging/WinstonRequestLogger.ts @@ -1,3 +1,4 @@ +import path from "node:path"; import { IAsyncQueue } from "@spt/models/spt/utils/IAsyncQueue"; import { AbstractWinstonLogger } from "@spt/utils/logging/AbstractWinstonLogger"; import { inject, injectable } from "tsyringe"; @@ -21,7 +22,7 @@ export class WinstonRequestLogger extends AbstractWinstonLogger { } protected getFilePath(): string { - return "./user/logs/requests/"; + return path.join("user", "logs", "requests"); } protected getFileName(): string {