From 540ac283cb522f2bd0e779624fbe3a8b13b544ed Mon Sep 17 00:00:00 2001 From: Daniel Haselhan Date: Thu, 7 Mar 2024 13:08:30 -0800 Subject: [PATCH] Logging changes * Don't log all headers, they have the auth key and don't really help anyway * Prevent keycloak from logging every token expiry --- services/apps/alcs/src/main.module.ts | 3 +++ services/apps/alcs/src/main.ts | 2 +- .../alcs/src/providers/keycloak/keycloak-config.service.ts | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/services/apps/alcs/src/main.module.ts b/services/apps/alcs/src/main.module.ts index 2983653d97..fb10cabf27 100644 --- a/services/apps/alcs/src/main.module.ts +++ b/services/apps/alcs/src/main.module.ts @@ -46,6 +46,9 @@ import { UserModule } from './user/user.module'; RedisModule, LoggerModule.forRoot({ pinoHttp: { + redact: { + paths: ['req.headers'], + }, level: config.get('LOG_LEVEL'), autoLogging: false, //Disable auto-logging every request/response for now transport: diff --git a/services/apps/alcs/src/main.ts b/services/apps/alcs/src/main.ts index 372dcf6e0d..9ac498d284 100644 --- a/services/apps/alcs/src/main.ts +++ b/services/apps/alcs/src/main.ts @@ -12,7 +12,7 @@ import * as config from 'config'; import { Logger } from 'nestjs-pino'; import { install } from 'source-map-support'; import { generateModuleGraph } from './commands/graph'; -import { importApplications, importNOIs } from './commands/import'; +import { importApplications } from './commands/import'; import { MainModule } from './main.module'; const registerSwagger = (app: NestFastifyApplication) => { diff --git a/services/apps/alcs/src/providers/keycloak/keycloak-config.service.ts b/services/apps/alcs/src/providers/keycloak/keycloak-config.service.ts index 99e315c2eb..ed45853805 100644 --- a/services/apps/alcs/src/providers/keycloak/keycloak-config.service.ts +++ b/services/apps/alcs/src/providers/keycloak/keycloak-config.service.ts @@ -20,6 +20,7 @@ export class KeycloakConfigService implements KeycloakConnectOptionsFactory { 'confidential-port': 0, tokenValidation: TokenValidation.OFFLINE, verifyTokenAudience: true, + logLevels: [], //Disable Expired Token Messages }; } }