Skip to content

Commit 1b39bc1

Browse files
committed
more logs
1 parent f8a275a commit 1b39bc1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/versioned-server.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,22 @@ export async function runVersionedSSECloudServer() {
339339
'';
340340
const sidLogV2 = existingSessionId || 'init';
341341
console.log(`[V2][HTTP][sid:${sidLogV2}] Route entered`);
342+
console.log(
343+
`[V2][HTTP][sid:${sidLogV2}] headers accept=${req.headers['accept'] || ''} content-type=${req.headers['content-type'] || ''}`
344+
);
345+
if (body && typeof body === 'object') {
346+
console.log(
347+
`[V2][HTTP][sid:${sidLogV2}] body.method=${(body as any).method || ''}`
348+
);
349+
}
350+
const startTs = Date.now();
351+
res.on('finish', () => {
352+
console.log(
353+
`[V2][HTTP][sid:${sidLogV2}] response status=${res.statusCode} content-type=${String(
354+
res.getHeader('content-type') || ''
355+
)} duration=${Date.now() - startTs}ms`
356+
);
357+
});
342358
if (existingSessionId) {
343359
console.log(
344360
`[V2][HTTP][sid:${existingSessionId}] Incoming ${req.method}`

0 commit comments

Comments
 (0)