From 576e844e2c99d2abce30ed0c2751b9e8c5d28515 Mon Sep 17 00:00:00 2001 From: Dimitriys Date: Tue, 19 Nov 2024 13:35:22 +0300 Subject: [PATCH 1/2] Add timestamp to log --- src/logger.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/logger.ts b/src/logger.ts index d30d28d1..f3850401 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -1,6 +1,10 @@ import * as winston from "winston" export const logger = winston.createLogger({ + format: winston.format.combine( + winston.format.timestamp({ format: "YYYY-MM-DD hh:mm:ss A" }), + winston.format.json() + ), levels: winston.config.syslog.levels, transports: [ new winston.transports.Console() ], }) From 2f56211a8bd15d61b7ace61f6749f625304132b2 Mon Sep 17 00:00:00 2001 From: Dimitriys Date: Tue, 19 Nov 2024 14:57:33 +0300 Subject: [PATCH 2/2] Fix timestamp format --- src/logger.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logger.ts b/src/logger.ts index f3850401..b45f0899 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -2,7 +2,7 @@ import * as winston from "winston" export const logger = winston.createLogger({ format: winston.format.combine( - winston.format.timestamp({ format: "YYYY-MM-DD hh:mm:ss A" }), + winston.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss" }), winston.format.json() ), levels: winston.config.syslog.levels,