From b3d6c983719560b6d3e2eb17b413f1147f2522a1 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 8 Oct 2026 12:03:38 -0700 Subject: Remove response logger Co-Authored-By: Claude Opus 5.5 --- lib/app.ts | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib/app.ts b/lib/app.ts index faf3d9bd..b2c3c1a7 100644 --- a/lib/app.ts +++ b/lib/app.ts @@ -21,7 +21,6 @@ const app = fastify({ }); const reqLogger = pino(pino.destination("req")); -const resLogger = pino(pino.destination("res")); // Never log plaintext credentials. This MUST recurse: the previous version // only redacted top-level keys, but POST /register posts {user:{password}} — @@ -136,24 +135,6 @@ app.addHook("preHandler", async (req) => { }); }); -app.addHook("onResponse", async (req, reply) => { - const rawCookies = req.raw.headers.cookie || ""; - - const cookies: any = rawCookies.split(";").reduce((acc, cookie) => { - const [key, value] = cookie.split("=").map((s) => s.trim()); - if (key && value) acc[key] = value; - return acc; - }, {}); - - resLogger.info({ - id: req.id, - url: req.raw.url, - statusCode: reply.raw.statusCode, - durationMs: reply.elapsedTime, - username: cookies.username, - }); -}); - app.register(fastifyRateLimit, { allowList: (req) => req.raw.url?.includes("public"), max: 2000, -- cgit v1.2.3