Identity headers
All built-in adapters send two identity headers on every outgoing request:
| Header | Value |
|---|---|
User-Agent | evlog/<version> (Node / server runtimes only — browsers strip this header) |
X-Evlog-Source | The adapter name (axiom, datadog, otlp, posthog, sentry, better-stack, client, ...) |
The browser-side evlog/http drain (used by the client transport) sets X-Evlog-Source: client instead, since browsers cannot override User-Agent.
Why
- Quickly distinguish evlog traffic from other clients in the receiving system's logs.
- Track adapter usage / version drift centrally.
- Identify the source when debugging a specific drain.
Reading the version
Both constants are exported from evlog/toolkit:
import { EVLOG_USER_AGENT, EVLOG_VERSION } from 'evlog/toolkit'
console.log(EVLOG_VERSION) // → "2.16.0"
console.log(EVLOG_USER_AGENT) // → "evlog/2.16.0"
Custom drains
When you build a drain on top of httpPost from evlog/toolkit, identity headers are injected automatically. To override or suppress them:
import { httpPost } from 'evlog/toolkit'
await httpPost({
url: 'https://my-platform.example.com/ingest',
headers: { 'Content-Type': 'application/json' },
body: '[]',
timeout: 5000,
label: 'my-platform',
source: 'my-platform', // sent as X-Evlog-Source
userAgent: 'my-fork/1.0', // overrides the default User-Agent
// userAgent: false, // suppress the header entirely
})
Adapters built with defineHttpDrain() automatically pass the drain name as source.
Custom Integration
Build your own evlog framework integration using the toolkit API — defineFrameworkIntegration, createMiddlewareLogger, AsyncLocalStorage, and the full drain/enrich/keep pipeline.
FS reader
Replay and tail the local NDJSON drain with readFsLogs and tailFsLogs — works in-process or from any external Node tool.