logger
logger: (
options?) =>any
Defined in: http/logger.js:79
Creates a structured request/response logging middleware.
Parameters
Section titled “Parameters”options?
Section titled “options?”Logger configuration
error?
Section titled “error?”Function = console.error
Log function for errors (default: console.error)
headerRequestIdName?
Section titled “headerRequestIdName?”string = 'x-request-id'
Request ID header name (default: ‘x-request-id’)
headerRequestIpName?
Section titled “headerRequestIpName?”string = 'x-real-ip'
Client IP header name (default: ‘x-real-ip’)
Function = console.log
Log function for completed requests (default: console.log)
redactHeaders?
Section titled “redactHeaders?”Set<string> = DEFAULT_REDACTED
Header names to replace with ‘[REDACTED]’ in logs (default: authorization, proxy-authorization, cookie, set-cookie)
Function = randomUUID
Fallback UUID generator used only when no upstream request ID is found on the response or request headers (default: crypto.randomUUID)
Returns
Section titled “Returns”any
- Log entry with request metadata and host info (statusCode/duration added on finish)