Skip to content

AccessLogHook

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

Observability hook called around RPC dispatch. Implementations must be safe for concurrent use (HTTP transport is concurrent).

new AccessLogHook(sink, options?): AccessLogHook;

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

Parameter Type
sink AccessLogSink
options | string | AccessLogOptions

AccessLogHook

get droppedRecords(): number;

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

Records lost to a full queue and not yet reported. Diagnostics only — the count is reported in-band on the next record through.

number

flush(): void;

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

Drain any queued records immediately. No-op for a synchronous hook; call it on shutdown when async is enabled.

void


onDispatchEnd(
token,
info,
stats,
error?): void;

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

Emit one access-log JSON record for the completed dispatch (best-effort; write errors are swallowed so logging never breaks a request).

Parameter Type
token unknown
info DispatchInfo
stats CallStatistics
error? Error

void

DispatchHook.onDispatchEnd


onDispatchStart(_info): unknown;

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

Capture a high-resolution start timestamp; returned token feeds onDispatchEnd.

Parameter Type
_info DispatchInfo

unknown

DispatchHook.onDispatchStart