diff --git a/packages/api/src/logger.ts b/packages/api/src/logger.ts index 8a53479c6a..d9c1fc7875 100644 --- a/packages/api/src/logger.ts +++ b/packages/api/src/logger.ts @@ -5,9 +5,11 @@ import { format, transports, Logform } from "winston"; export const getLogger = (environment: string, logLevel: string): LoggerService => { let defaultLogLevel = "debug"; const loggerFormatters: Logform.Format[] = [ - format.timestamp({ - format: "DD/MM/YYYY HH:mm:ss.SSS", - }), + environment === "production" + ? format.timestamp() + : format.timestamp({ + format: "DD/MM/YYYY HH:mm:ss.SSS", + }), format.ms(), utilities.format.nestLike("API", {}), ]; diff --git a/packages/data-fetcher/src/logger.ts b/packages/data-fetcher/src/logger.ts index 76f0e87c08..29d66a8d32 100644 --- a/packages/data-fetcher/src/logger.ts +++ b/packages/data-fetcher/src/logger.ts @@ -5,9 +5,11 @@ const { NODE_ENV, LOG_LEVEL } = process.env; let defaultLogLevel = "debug"; const loggerFormatters: Logform.Format[] = [ - format.timestamp({ - format: "DD/MM/YYYY HH:mm:ss.SSS", - }), + NODE_ENV === "production" + ? format.timestamp() + : format.timestamp({ + format: "DD/MM/YYYY HH:mm:ss.SSS", + }), format.ms(), utilities.format.nestLike("DataFetcher", {}), ]; diff --git a/packages/worker/src/logger.ts b/packages/worker/src/logger.ts index 48476324d8..ff731998bc 100644 --- a/packages/worker/src/logger.ts +++ b/packages/worker/src/logger.ts @@ -5,9 +5,11 @@ const { NODE_ENV, LOG_LEVEL } = process.env; let defaultLogLevel = "debug"; const loggerFormatters: Logform.Format[] = [ - format.timestamp({ - format: "DD/MM/YYYY HH:mm:ss.SSS", - }), + NODE_ENV === "production" + ? format.timestamp() + : format.timestamp({ + format: "DD/MM/YYYY HH:mm:ss.SSS", + }), format.ms(), utilities.format.nestLike("Worker", {}), ];