From 6f60968dfe94d00d6a600653a55fe8cd83d2d446 Mon Sep 17 00:00:00 2001 From: fenos Date: Wed, 4 Dec 2024 18:53:08 +0100 Subject: [PATCH] fix: log when unable to send logs to logflare --- src/internal/monitoring/logflare.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/internal/monitoring/logflare.ts b/src/internal/monitoring/logflare.ts index fa41914e..4be344d3 100644 --- a/src/internal/monitoring/logflare.ts +++ b/src/internal/monitoring/logflare.ts @@ -22,6 +22,9 @@ export default function () { return createLogFlareWriteStream({ apiKey: logflareApiKey, sourceToken: logflareSourceToken, + onError: (err: Error) => { + console.error(`[Logflare][Error] ${err.message} - ${err.stack}`) + }, onPreparePayload: (payload: any, meta: any) => { const item = defaultPreparePayload(payload, meta) item.project = payload.project