Log project ID with every request

This commit is contained in:
Konstantin Wohlwend 2026-06-04 15:57:55 -07:00
parent c80b087316
commit c3b043ef1e

View File

@ -126,7 +126,7 @@ export function handleApiRequest(handler: (req: NextRequest, options: any, reque
}
});
if (!disableExtendedLogging) console.log(`[API REQ] [${requestId}] ${req.method} ${censoredUrl}`);
if (!disableExtendedLogging) console.log(`[API REQ] [${requestId} @ ${req.headers.get("x-stack-project-id") ?? "<none>"}] ${req.method} ${censoredUrl}`);
const timeStart = performance.now();
const res = await handler(req, options, requestId);
const time = (performance.now() - timeStart);