From 75b283328cdc0e16e3f36bb0dc216536312cbff1 Mon Sep 17 00:00:00 2001 From: rtrompier Date: Fri, 3 May 2024 11:06:16 +0200 Subject: [PATCH] refacto(all): add request logs --- src/hooks.server.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/hooks.server.ts b/src/hooks.server.ts index 408f3d8b8f7..f69b1bca83b 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -70,14 +70,12 @@ export const handleError: HandleServerError = async ({ error, event }) => { }; export const handle: Handle = async ({ event, resolve }) => { - // only allow metrics from localhost if we're not in dev mode - if ( - event.url.pathname.startsWith(`${base}/metrics`) && - !dev && - event.request.headers.get("host") !== "localhost:3000" - ) { - return new Response("Forbidden", { status: 403 }); - } + logger.info({ + locals: event.locals, + url: event.url.pathname, + params: event.params, + request: event.request, + }); if (event.url.pathname.startsWith(`${base}/api/`) && EXPOSE_API !== "true") { return new Response("API is disabled", { status: 403 });