Observers overview
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:
| What | Scope | |
|---|---|---|
| In-process stream | createStreamDrain() — sync subscribers, async iterator, ring buffer | The subscriber lives in the same Node process |
| Stream server | Local HTTP mini-server exposing the stream over SSE | Browser tab, CLI, external devtool needs to connect over HTTP |
| FS reader | readFsLogs() and tailFsLogs() over the NDJSON drain | Historical 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.
Overview
How to extend evlog along five orthogonal axes — sources, pipeline, sinks, observers, and shared packages — from a solo dev's local debug tool to a platform team's shared catalogs.
Stream API
Subscribe to wide events flowing through evlog, in-process, with createStreamDrain — sync listeners, async iterators, and a ring buffer.