From c4de9a2262d0caa6b62f013b9d17095c193a1fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20J=C3=A4derberg?= Date: Wed, 26 Nov 2025 13:03:28 +0000 Subject: [PATCH] Merged in fix/logging-warmup-background (pull request #3235) Fix/logging warmup background * fix: logging in background functions * fix logging * fix logging * fix logging * fix: add error logging when unable to get from cache * Merge branch 'master' of bitbucket.org:scandic-swap/web into fix/logging-warmup-background Approved-by: Linus Flood --- packages/common/dataCache/DistributedCache/get.ts | 2 ++ packages/common/logger/createLogger/index.ts | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/packages/common/dataCache/DistributedCache/get.ts b/packages/common/dataCache/DistributedCache/get.ts index cedf7ccb1..bc6db5aeb 100644 --- a/packages/common/dataCache/DistributedCache/get.ts +++ b/packages/common/dataCache/DistributedCache/get.ts @@ -35,7 +35,9 @@ export async function get(key: string) { cacheKey: key, statusCode: response?.status, statusText: response?.statusText, + isJson, contentType: response?.headers.get("content-type"), + error: serializeError(error), }) Sentry.captureException(error ?? new Error("Unable to GET cachekey"), { diff --git a/packages/common/logger/createLogger/index.ts b/packages/common/logger/createLogger/index.ts index b7924bce9..fbefb4aaf 100644 --- a/packages/common/logger/createLogger/index.ts +++ b/packages/common/logger/createLogger/index.ts @@ -14,6 +14,16 @@ function getLogValue(args: unknown[]): Record | undefined { return (args[0] as Record) ?? undefined } if (args.length === 1) { + if (args[0] instanceof Error) { + return { + error: { + message: args[0].message, + stack: args[0].stack, + name: args[0].name, + cause: String(args[0].cause), + }, + } + } return { value: args[0] } } return flatten(args)