From fd4c2fe3873f3642335365c7709fd74de0283771 Mon Sep 17 00:00:00 2001 From: Viachaslau Date: Fri, 27 Sep 2024 10:15:46 +0400 Subject: [PATCH] chore: fastify logger configuration (#412) --- .env | 3 +++ src/main.ts | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/.env b/.env index f4927309..2dc24f8e 100644 --- a/.env +++ b/.env @@ -16,6 +16,9 @@ JWK_PUBLIC_JSON=config/keys/jwk.pub.json JKU_URL=https://raw.githubusercontent.com/NeuraLegion/brokencrystals/development/config/keys/jku.json X5U_URL=https://raw.githubusercontent.com/NeuraLegion/brokencrystals/development/config/keys/x509.crt +FASTIFY_LOGGER=true +FASTIFY_LOG_LEVEL=warn + KEYCLOAK_SERVER_URI=https://auth.qa.brokencrystals.com/auth KEYCLOAK_REALM=brokencrystals KEYCLOAK_ADMIN_CLIENT_ID=admin-cli diff --git a/src/main.ts b/src/main.ts index 056e71da..89a3f4cd 100644 --- a/src/main.ts +++ b/src/main.ts @@ -76,6 +76,10 @@ async function bootstrap() { https.globalAgent.maxSockets = Infinity; const server = fastify({ + logger: + process.env.FASTIFY_LOGGER === 'true' + ? { level: process.env.FASTIFY_LOG_LEVEL || 'warn' } + : false, trustProxy: true, onProtoPoisoning: 'ignore', https: