Sources

Sources overview

Sources are how events enter the evlog pipeline — framework integrations, custom middleware, ingest endpoints. Where to extend when you support a new runtime.

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

WhatWhen
Custom framework integrationThe defineFrameworkIntegration pattern + middleware toolkitYou're adding HTTP framework X
Middleware toolkitcreateMiddlewareLogger, attachLogger, request-context helpersYou'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.