Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit cd06258

Browse files
committed
chore(core): log headers with _RIVET_LOG_HEADERS (#1397)
1 parent 057bb73 commit cd06258

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/rivetkit/src/common/router.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { getEndpoint } from "@/remote-manager-driver/api-utils";
1111
import { HttpResponseError } from "@/schemas/client-protocol/mod";
1212
import { HTTP_RESPONSE_ERROR_VERSIONED } from "@/schemas/client-protocol/versioned";
1313
import { encodingIsBinary, serializeWithEncoding } from "@/serde";
14-
import { bufferToArrayBuffer, VERSION } from "@/utils";
14+
import { bufferToArrayBuffer, getEnvUniversal, VERSION } from "@/utils";
1515
import { getLogger, type Logger } from "./log";
1616
import { deconstructError, stringifyError } from "./utils";
1717

@@ -37,6 +37,9 @@ export function loggerMiddleware(logger: Logger) {
3737
reqSize: c.req.header("content-length"),
3838
resSize: c.res.headers.get("content-length"),
3939
userAgent: c.req.header("user-agent"),
40+
...(getEnvUniversal("_RIVET_LOG_HEADERS")
41+
? { allHeaders: JSON.stringify(c.req.header()) }
42+
: {}),
4043
});
4144
};
4245
}

0 commit comments

Comments
 (0)