Skip to content

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.

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.


optional level?: "INFO" | "DEBUG";

Defined in: src/access-log.ts:341


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.


optional queueSize?: number;

Defined in: src/access-log.ts:361

Queue depth when async is set. Default: 10000.


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.


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.

RangeError at construction when out of range.


optional serverVersion?: string;

Defined in: src/access-log.ts:335

Server version string (optional).


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.