Build on top

Build on top of evlog

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.

Everything you build on top of evlog falls on one of four axes in the data flow, plus a fifth transverse axis for code you want to share between projects.

                                                          ┌─────────────────────┐
                                                          │  SOURCES            │  How events enter
                                                          │  (frameworks,       │  the pipeline
                                                          │   custom middleware)│
                                                          └──────────┬──────────┘
                                                                     │
                                                                     ▼
                                                          ┌─────────────────────┐
                              OBSERVERS                   │  PIPELINE           │  What happens to them
                              (read-only:        ◀────────│  (plugins,          │  on the way through
                              streams, fs reader)         │   enrichers,        │
                                                          │   sampling)         │
                                                          └──────────┬──────────┘
                                                                     │
                                                                     ▼
                                                          ┌─────────────────────┐
                                                          │  SINKS              │  Where they go
                                                          │  (drains: Axiom,    │
                                                          │   Datadog, fs, …,   │
                                                          │   custom)           │
                                                          └─────────────────────┘

                              SHARED PACKAGES (catalogs, drains, enrichers, integrations
                              packaged as reusable npm libraries — orthogonal to all four axes)
Use this page as a directory. Pick the question that matches your need and follow the link. Each axis page goes deeper on its surface; each scenario page bundles a few axes for a specific real-world job.

I want to…

QuestionAnswer
Add a service that receives my logs (Axiom, an internal API…)Custom drains
Tint events with my own context (tenant id, deploy id, region…)Custom enrichers
Decide live whether to keep an event based on the request outcomeTail sampling
React to specific events (alert, side-effect, tracing)Plugins
Combine several drains with retry, batching, fanoutDrain pipeline
See events live while I devStream server
Subscribe in-process from a script or testStream API
Replay or tail historic logsFS reader
Identify my evlog traffic on the receiver sideIdentity headers
Support a framework that's not in the listCustom framework
Share an error vocabulary between several servicesCatalogs as packages
Build a quick local devtoolLocal debugging toolkit
Handle multi-tenant context everywhereTenant-aware logging
Wire compliance-grade auditingCompliance audit

By stage of your app

StageTypical needsPages
Solo / hobby — one app, local devLive events while debugging, log replayStream server, FS reader, Local debugging toolkit
Small team — one app in productionSend to a provider, redact PII, tag trafficSinks overview, Identity headers
Scale — single product, real prodCustom enrichers, tail sampling, plugins, multi-drain fanoutPipeline overview, Sinks overview, Tenant-aware logging
Platform — N apps sharing infraShared catalogs, custom drains/enrichers/integrations as npm packagesShared packages

By axis

Sources — how events enter

Sources overview

evlog/<framework> middlewares plug HTTP requests into the pipeline. When you write your own framework support (a new HTTP runtime, a CLI driver, a queue worker), you live here.

Pipeline — what happens during

Pipeline overview

Plugins, enrichers, sampling rules, redaction custom — anything that transforms or decides about an event between emit and drain.

Sinks — where events go

Sinks overview

Built-in drain adapters (Axiom, Datadog, fs, …) plus the building blocks to write your own: defineDrain(), defineHttpDrain(), the drain pipeline (batch + retry + fanout), and identity headers.

Observers — read the flow

Observers overview

Subscribe to wide events without altering the pipeline. In-process pub/sub primitive, network SSE bridge, fs replay/tail, and concrete consumer recipes.

Shared — package for others

Shared packages overview

Turn a catalog, a drain, an enricher, or a framework integration into an npm package others can install. Same pattern for each : a small bit of typed code + module augmentation.

A note on serverless

The in-process stream and the stream server work everywhere a Node-like long-lived process runs — local dev, self-hosted servers, containers (Fly, Railway, Coolify), VMs.

They do not work on serverless platforms (Vercel Functions, Cloudflare Workers, AWS Lambda) because each invocation is an isolated process. Use a real broker (Redis Streams, NATS, Pub/Sub) for cross-instance fan-out in those environments.

The fs reader, identity headers, and the entire Pipeline / Sinks / Shared axes work everywhere — they are not bound to a long-lived process.