Sources overview
A source is anything that creates wide events and feeds them into the drain pipeline. The built-in sources cover the HTTP frameworks evlog ships integrations for (Frameworks overview), the browser client, and integrations with specific products (AI SDK, Better Auth).
You write a custom source when:
- You want to support a new HTTP runtime that doesn't have a
evlog/<framework>package yet - You build a non-HTTP source (a queue worker, a CLI driver, a cron job) and want it to log wide events the same way
- You wrap evlog into your own internal framework
Pages here
| What | When | |
|---|---|---|
| Custom framework integration | The defineFrameworkIntegration pattern + middleware toolkit | You're adding HTTP framework X |
| Middleware toolkit | createMiddlewareLogger, attachLogger, request-context helpers | You're piecing together your own integration without going full framework |
Going further
Once your source feeds events into the pipeline, the rest of the chain is the same as for any built-in source — apply enrichers, drains, or just observe the flow.
If your integration is meant to be reused across projects, package it as an npm library.
Fanout
Send the same wide event to several destinations in parallel — Axiom plus Datadog plus Sentry plus the local fs drain — through a single pipeline.
Custom framework
Build evlog support for an HTTP framework that doesn't ship a built-in integration — Medusa, AdonisJS, h3 directly, custom dispatchers, queue workers.