> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sazabi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# evlog log source (send to endpoint)

> Send evlog wide events and structured errors from your TypeScript app to Sazabi with evlog's built-in Sazabi drain.

[All evlog integration capabilities](https://docs.sazabi.com/catalogs/integrations/evlog)

## About

Send the wide events and structured errors your app logs with [evlog](https://www.evlog.dev) 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

**Step 1**

### 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.

```bash theme={"system"}
SAZABI_INTAKE_URL=https://your-intake-url
```

**Step 2**

### Add the Sazabi drain

Pass `createSazabiDrain()` to evlog where your framework configures it. For example, in Nuxt add a server plugin:

```typescript theme={"system"}
// 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`:

```typescript theme={"system"}
// 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:

```typescript theme={"system"}
// 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](https://www.evlog.dev/integrate/adapters/cloud/sazabi).

**Step 3**

### Redeploy the app

Redeploy or restart the app so it picks up the drain and the `SAZABI_INTAKE_URL` environment variable.

**Step 4**

### 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](https://docs.sazabi.com/reference/cli.md) (installed and authenticated — see [CLI reference](https://docs.sazabi.com/reference/cli/log-sources.md)).

Registering the source mints the same intake URL the dashboard shows above (the public key is embedded in its hostname):

```bash theme={"system"}
sazabi log-sources create evlog
```

The 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](https://docs.sazabi.com/send-data/intake.md) 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.

## Further reading

> [card] [Intake](https://docs.sazabi.com/send-data/intake.md)
>
> See per-source ingestion volume and health in the Intake page.

> [card] [Instrument](https://docs.sazabi.com/send-data.md)
>
> Learn how to send data to Sazabi.

> [card] [Log sources](https://docs.sazabi.com/catalogs/integrations.md#log-sources)
>
> Browse the full log source catalog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.