AccessLogOptions
Defined in: src/access-log.ts:337
Options for AccessLogHook.
level matches Python’s logger-level gating in _emit_access_log: at
“INFO” the heavy request_data field (a base64 of the full request batch —
typically 8+ KiB per init RPC) is replaced with a
truncated: "payload_omitted" marker plus original_request_bytes, so the
access-log schema’s “unary requires request_data unless truncated”
invariant still holds. Bump to “DEBUG” to capture full payloads for
replay/audit.
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
Verbosity for heavy fields. Default: “INFO”.
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 (request_data, then 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:339
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.
