From 6447d0e21e7dc96286b979983f8645b693f0ba02 Mon Sep 17 00:00:00 2001 From: Henry Fontanier Date: Thu, 26 Oct 2023 15:58:49 +0200 Subject: [PATCH] fix: proper json logging (#2281) --- connectors/src/api_server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/connectors/src/api_server.ts b/connectors/src/api_server.ts index 35abe8b32af2..a45f2c661420 100644 --- a/connectors/src/api_server.ts +++ b/connectors/src/api_server.ts @@ -28,11 +28,11 @@ import { authMiddleware } from "@connectors/middleware/auth"; export function startServer(port: number) { process.on("unhandledRejection", (reason, promise) => { - logger.error("Unhandled Rejection at:", promise, "reason:", reason); + logger.error({ promise, reason }, "Unhandled Rejection"); }); process.on("uncaughtException", (error) => { - logger.error("Uncaught Exception thrown", error); + logger.error({ error }, "Uncaught Exception"); }); const app = express();