evlog
Send evlog wide events and structured errors from your TypeScript app to Sazabi with evlog's built-in Sazabi drain.
All evlog integration capabilities
About
Send the wide events and structured errors your app logs with evlog to Sazabi. evlog includes a Sazabi drain: it batches the events your app emits and sends them to your intake URL over OpenTelemetry. Each request arrives as one event with every field your code adds, and errors keep their name, message, stack, and evlog's why, fix, and link.
Prerequisites
- A TypeScript app that logs with evlog. The Sazabi drain ships in evlog 2.32.0; on an older version, upgrade first with
npm install evlog@latest. - Your Sazabi intake URL (shown above).
Set up in the dashboard
Set the intake URL
Set SAZABI_INTAKE_URL to your intake URL (shown above) wherever your app keeps its server environment. The Sazabi drain reads this variable and adds the /v1/logs path itself, so use the URL as shown.
SAZABI_INTAKE_URL=https://your-intake-urlAdd the Sazabi drain
Pass createSazabiDrain() to evlog where your framework configures it. For example, in Nuxt add a server plugin:
// server/plugins/evlog-drain.ts
import { createSazabiDrain } from "evlog/sazabi";
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook("evlog:drain", createSazabiDrain());
});In Next.js, pass it to createEvlog:
// lib/evlog.ts
import { createEvlog } from "evlog/next";
import { createSazabiDrain } from "evlog/sazabi";
export const { withEvlog, useLogger, log, createError } = createEvlog({
service: "my-app",
drain: createSazabiDrain(),
});In Hono or Express, pass it to the evlog middleware:
// src/index.ts
import { evlog } from "evlog/hono"; // or "evlog/express"
import { createSazabiDrain } from "evlog/sazabi";
app.use(evlog({ drain: createSazabiDrain() }));The dashboard also shows SvelteKit and Fastify. For every other framework, see evlog's Sazabi adapter docs.
Redeploy the app
Redeploy or restart the app so it picks up the drain and the SAZABI_INTAKE_URL environment variable.
Hand off the change
Commit these changes on a new branch, push it, and open a pull request. Keep the intake URL in environment variables or a secret store, and commit only code that references it.
Set up with the CLI
You can also register the evlog log source with the Sazabi CLI (installed and authenticated — see CLI reference).
Registering the source mints the same intake URL the dashboard shows above (the public key is embedded in its hostname):
sazabi log-sources create evlogThe command prints the intake URL for the new source. Set it as SAZABI_INTAKE_URL and add the drain as shown above. Run sazabi log-sources get <log-source-id> at any time to reprint the endpoint, or sazabi log-sources list to see every log source in the project.
Verify
Send a few requests to your app. Open the Intake page in the Sazabi dashboard and confirm events from the evlog source appear. A request event's message is evlog's summary line, like GET /api/products (200). An error event's message is the error's own message, like Payment declined by the issuer. The request's fields, such as method, path, and status, arrive as attributes.
Troubleshooting
The app logs [evlog/sazabi] Missing endpoint — SAZABI_INTAKE_URL is not set in the environment the server runs in. Set it there and restart the app.
No events appear — Confirm the app runs evlog 2.32.0 or later and that the drain is passed to the evlog integration that handles your requests.
Events arrive under an unexpected service name — Set evlog's service option, or the SAZABI_SERVICE_NAME environment variable.