Observers

Observers overview

Observers read what flows through the pipeline without altering it — in-process subscribe, network SSE bridge, fs replay, recipes for browser tabs and CLIs.

An observer subscribes to events as they flow through evlog without participating in the pipeline. Drains send events somewhere; observers just watch. They're the surface you build on for devtools, dashboards, ad-hoc CLIs, and replay-then-live analytics.

Three primitives, each addressing a different scope:

WhatScope
In-process streamcreateStreamDrain() — sync subscribers, async iterator, ring bufferThe subscriber lives in the same Node process
Stream serverLocal HTTP mini-server exposing the stream over SSEBrowser tab, CLI, external devtool needs to connect over HTTP
FS readerreadFsLogs() and tailFsLogs() over the NDJSON drainHistorical replay, post-incident triage, sidecar processes

Plus concrete copy-paste patterns:

  • Consumer recipes — minimal devtool (vanilla / Vue / React), curl + jq, Node fetch, replay-then-live, consumer-side aggregation.

A note on serverless

The stream API and stream server live in-process — they only see events from the same Node process they're embedded in. On serverless platforms (Vercel Functions, Cloudflare Workers, AWS Lambda) each invocation is isolated, so a subscriber would only see its own isolate's events.

The FS reader has no such limitation: it just parses files on disk, so it works anywhere you can mount the .evlog/logs/ directory.