fix(console-log): initialize capture at server boot + prevent SSE proxy buffering
Initialize initConsoleLogCapture() via Next.js instrumentation register() hook so logs are captured from startup in headless/Docker deployments, and add X-Accel-Buffering/Cache-Control headers to the SSE stream route to prevent reverse proxies from buffering the initial payload.
This commit is contained in:
6
src/instrumentation.js
Normal file
6
src/instrumentation.js
Normal file
@@ -0,0 +1,6 @@
|
||||
export async function register() {
|
||||
if (process.env.NEXT_RUNTIME === "nodejs") {
|
||||
const { initConsoleLogCapture } = await import("@/lib/consoleLogBuffer");
|
||||
initConsoleLogCapture();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user