From 37bf482686636198ced60a76cbd8843e775712cc Mon Sep 17 00:00:00 2001 From: Milo Schwartz Date: Fri, 20 Dec 2024 22:33:22 -0500 Subject: [PATCH] add machine logs back --- server/logger.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/server/logger.ts b/server/logger.ts index fe638fb2..530a8105 100644 --- a/server/logger.ts +++ b/server/logger.ts @@ -30,6 +30,22 @@ if (config.app.save_logs) { symlinkName: "pangolin.log" }) ); + transports.push( + new winston.transports.DailyRotateFile({ + filename: path.join(APP_PATH, "logs", ".machinelogs-%DATE%.json"), + datePattern: "YYYY-MM-DD", + zippedArchive: true, + maxSize: "20m", + maxFiles: "1d", + createSymlink: true, + symlinkName: ".machinelogs.json", + format: winston.format.combine( + winston.format.timestamp(), + winston.format.splat(), + winston.format.json() + ) + }) + ); } const logger = winston.createLogger({