From e4a04bdf0a93c7f752dddb5d53e1202d50d10eeb Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Tue, 21 Nov 2023 15:11:19 -0500 Subject: [PATCH] set log level to info and output to file --- backend/src/utils/logging/logger.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/src/utils/logging/logger.ts b/backend/src/utils/logging/logger.ts index 17a8357d3..1fb6ebc4c 100644 --- a/backend/src/utils/logging/logger.ts +++ b/backend/src/utils/logging/logger.ts @@ -9,14 +9,14 @@ export const initLogger = async () => { const isProduction = nodeEnv === "production"; const targets: pino.TransportMultiOptions["targets"][number][] = [ isProduction - ? { level: "trace", target: "pino/file", options: {} } + ? { level: "info", target: "pino/file", options: { destination: 'logs/infisical-backend/logs.txt', mkdir: true } } : { - level: "info", - target: "pino-pretty", // must be installed separately - options: { - colorize: true - } + level: "info", + target: "pino-pretty", // must be installed separately + options: { + colorize: true } + } ]; if (awsCloudWatchLogCfg) { @@ -40,7 +40,7 @@ export const initLogger = async () => { logger = pino( { - level: process.env.PINO_LOG_LEVEL || "trace", + level: process.env.PINO_LOG_LEVEL || "info", formatters: { bindings: (bindings) => { return {