AccessLogOptions
Defined in: src/access-log.ts:333
Options for AccessLogHook.
No option makes the log carry a payload value. Records describe the request
by request_fields (names and types) and request_rows, and stream state
tokens by request_state_bytes / response_state_bytes – at every level.
The framework cannot know which parameters are secret (a VGI
catalog_attach carries API keys and passwords), so a flag that logged
them would be a credential leak waiting for someone to turn DEBUG on.
Properties
Section titled “Properties”async?
Section titled “async?”optional async?: boolean;Defined in: src/access-log.ts:359
Drain records through a bounded queue instead of writing inline. Opt-in: it trades the guarantee that a record on disk means the call completed. Default: false.
level?
Section titled “level?”optional level?: "INFO" | "DEBUG";Defined in: src/access-log.ts:341
maxRecordBytes?
Section titled “maxRecordBytes?”optional maxRecordBytes?: number;Defined in: src/access-log.ts:348
Per-record byte cap. Records above it shed fields in the order the spec
mandates (claims, then a sentinel form) so log shippers with a
per-line ceiling do not drop the line outright. Default: 1 MiB. Pass 0
to disable.
queueSize?
Section titled “queueSize?”optional queueSize?: number;Defined in: src/access-log.ts:361
Queue depth when async is set. Default: 10000.
redactor?
Section titled “redactor?”optional redactor?: ClaimRedactor;Defined in: src/access-log.ts:368
Claim-redaction policy. Defaults to redactClaims; pass noRedaction for a service that owns its logs end to end.
sampleRate?
Section titled “sampleRate?”optional sampleRate?: number;Defined in: src/access-log.ts:355
Fraction of successful calls to log, 0.0–1.0. Default 1.0 (log everything). Errors are always logged. See AccessLogSampler.
Throws
Section titled “Throws”RangeError at construction when out of range.
serverVersion?
Section titled “serverVersion?”optional serverVersion?: string;Defined in: src/access-log.ts:335
Server version string (optional).
traceContext?
Section titled “traceContext?”optional traceContext?: TraceContextResolver;Defined in: src/access-log.ts:365
Trace-context source. Defaults to otelTraceContext, which reads
the active OpenTelemetry span when @opentelemetry/api is installed and
is a no-op otherwise. Pass () => null to disable.
