# Get started

::tutorial-step{title="Install Evlog"}

Install Evlog in your application:

```sh [commands/install]
pnpm add evlog
```

::

::tutorial-step{title="Enable local capture"}

Enable local capture in a Vite application with Nitro 3:

```ts [vite.config.ts]
import { nitro } from 'nitro/vite'
import { defineConfig } from 'vite'
import { vitehub } from 'vite-hub'

export default defineConfig({
  plugins: [
    vitehub({ preset: 'node', logs: true, console: { auth: false, local: true } }),
    nitro(),
  ],
})
```

::

::tutorial-step{title="Add request data"}

Enrich the automatic request event through Evlog's framework adapter:

```ts [server/api/status.get.ts]
import { useLogger } from 'evlog/nitro/v3'
import { defineHandler } from 'nitro/h3'

export default defineHandler((event) => {
  useLogger(event).set({ message: 'Status checked', deployment: { environment: 'development' } })
  return { ok: true }
})
```

::

::tutorial-step{title="Inspect the request"}

Start your dev server:

```sh [commands/start]
pnpm vite dev
```

Request `/api/status`, then open `/_vitehub/logs`. Select a row to inspect its structured data. Switch between Explorer and Stream. Follow polls for new events.

::

Local `logs: true` capture currently supports Nitro 3. For Nuxt with Nitro 2, register Evlog through its official `evlog/nuxt` module and connect an [existing backend source](https://vitehub.dev/docs/logs/configure#read-an-existing-backend) through `logs: { source: './server/logs.ts' }` in the `vite-hub/nuxt` module options. Source mode leaves logger registration to the application.

The repository's `playground/logs` includes a checkout request, redaction, and a serialized Nostics diagnostic. Follow its README to run the example.

Local capture is development only. For production, configure an [existing backend source](https://vitehub.dev/docs/logs/configure#read-an-existing-backend).
