From cbb9354dab6e3b1f789f2156dff88caf23619821 Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Fri, 14 Jun 2024 16:06:53 +0530 Subject: [PATCH] chore: update debug level condition - add destType in cdkv2 handler - include extra fields in fillExcept logger option --- src/cdk/v2/handler.ts | 3 ++- src/logger.js | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/cdk/v2/handler.ts b/src/cdk/v2/handler.ts index fec6731ffc..74ebb716e6 100644 --- a/src/cdk/v2/handler.ts +++ b/src/cdk/v2/handler.ts @@ -88,7 +88,8 @@ export async function processCdkV2Workflow( bindings: Record = {}, ) { try { - logger.debug(`Processing cdkV2 workflow`); + logger.debug(`Processing cdkV2 workflow`, { destType }); + const workflowEngine = await getCachedWorkflowEngine(destType, feature, bindings); return await executeWorkflow(workflowEngine, parsedEvent, requestMetadata); } catch (error) { diff --git a/src/logger.js b/src/logger.js index 1e51fbdb81..ea50fa9273 100644 --- a/src/logger.js +++ b/src/logger.js @@ -6,7 +6,19 @@ const loggerImpl = process.env.LOGGER_IMPL ?? 'winston'; let logLevel = process.env.LOG_LEVEL ?? 'error'; -const logger = structuredLogger({ level: logLevel }); +const logger = structuredLogger({ + level: logLevel, + fillExcept: [ + 'destinationId', + 'sourceId', + 'destinationType', + 'workspaceId', + 'module', + 'implementation', + 'feature', + 'destType', + ], +}); const getLogger = () => { switch (loggerImpl) { @@ -77,7 +89,7 @@ const log = (logMethod, args) => { const debug = (...args) => { const logger = getLogger(); - if (LOGLEVELS.debug <= logLevel) { + if (LOGLEVELS.debug <= LOGLEVELS[logLevel]) { log(logger.debug, args); } };