From 182d0fa228d154d03db336ec6880e01ad4a51cc0 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Tue, 1 Oct 2024 18:38:02 +0100 Subject: [PATCH] fix: Better defaulting to NEXT_PUBLIC_LOGGER_LEVEL=4 (#16900) * fix: Better defaulting to NEXT_PUBLIC_LOGGER_LEVEL=4 * chore: Minor fixes to prettyLogTemplate (as it wasnt very pretty) --- packages/lib/logger.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/lib/logger.ts b/packages/lib/logger.ts index 7f00bfbdb0..d9f22f3a45 100644 --- a/packages/lib/logger.ts +++ b/packages/lib/logger.ts @@ -3,12 +3,12 @@ import { Logger } from "tslog"; import { IS_PRODUCTION } from "./constants"; const logger = new Logger({ - minLevel: parseInt(process.env.NEXT_PUBLIC_LOGGER_LEVEL ?? "4"), + minLevel: parseInt(process.env.NEXT_PUBLIC_LOGGER_LEVEL || "4"), maskValuesOfKeys: ["password", "passwordConfirmation", "credentials", "credential"], prettyLogTimeZone: IS_PRODUCTION ? "UTC" : "local", prettyErrorStackTemplate: " • {{fileName}}\t{{method}}\n\t{{filePathWithLine}}", // default prettyErrorTemplate: "\n{{errorName}} {{errorMessage}}\nerror stack:\n{{errorStack}}", // default - prettyLogTemplate: "{{hh}}:{{MM}}:{{ss}}:{{ms}}\t{{logLevelName}}", // default with exclusion of `{{filePathWithLine}}` + prettyLogTemplate: "{{hh}}:{{MM}}:{{ss}}:{{ms}} [{{logLevelName}}] ", // default with exclusion of `{{filePathWithLine}}` stylePrettyLogs: true, prettyLogStyles: { name: "yellow",