RequestLogConfig
Defined in: src/policies/observability/request-log.ts:11
Configuration for the requestLog policy.
Extends
Section titled “Extends”Properties
Section titled “Properties”extractFields()?
Section titled “extractFields()?”
optionalextractFields: (c) =>Record<string,unknown>
Defined in: src/policies/observability/request-log.ts:13
Additional fields to extract from the request
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”Record<string, unknown>
ipHeaders?
Section titled “ipHeaders?”
optionalipHeaders:string[]
Defined in: src/policies/observability/request-log.ts:17
Ordered list of headers to inspect for the client IP. Default: ["cf-connecting-ip", "x-forwarded-for"].
logRequestBody?
Section titled “logRequestBody?”
optionallogRequestBody:boolean
Defined in: src/policies/observability/request-log.ts:19
Log request body (opt-in). Default: false.
logResponseBody?
Section titled “logResponseBody?”
optionallogResponseBody:boolean
Defined in: src/policies/observability/request-log.ts:21
Log response body (opt-in). Default: false.
maxBodyLength?
Section titled “maxBodyLength?”
optionalmaxBodyLength:number
Defined in: src/policies/observability/request-log.ts:23
Maximum body size in bytes to capture. Default: 8192.
redactPaths?
Section titled “redactPaths?”
optionalredactPaths:string[]
Defined in: src/policies/observability/request-log.ts:25
JSON field paths to redact from logged bodies (e.g., ["password", "*.secret"]).
sink()?
Section titled “sink()?”
optionalsink: (entry) =>void|Promise<void>
Defined in: src/policies/observability/request-log.ts:15
Custom log sink — defaults to console.log with structured JSON
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void | Promise<void>
skip()?
Section titled “skip()?”
optionalskip: (c) =>boolean|Promise<boolean>
Defined in: src/policies/types.ts:33
Skip this policy when condition returns true
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”boolean | Promise<boolean>