You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Client logs output to the browser console with colored tags in development. Use for debugging and development - for production analytics, use dedicated services.
354
+
Client logs output to the browser console with colored tags in development.
355
+
356
+
#### Client Transport
357
+
358
+
To send client logs to your server for centralized logging, enable the transport:
359
+
360
+
```typescript
361
+
// nuxt.config.ts
362
+
exportdefaultdefineNuxtConfig({
363
+
modules: ['evlog/nuxt'],
364
+
evlog: {
365
+
transport: {
366
+
enabled: true, // Send client logs to server
367
+
},
368
+
},
369
+
})
370
+
```
371
+
372
+
When enabled:
373
+
1. Client logs are sent to `/api/_evlog/ingest` via POST
374
+
2. Server enriches with environment context (service, version, etc.)
375
+
3.`evlog:drain` hook is called with `source: 'client'`
// Optional: only log specific routes (supports glob patterns)
99
99
include: ['/api/**'],
100
+
// Optional: send client logs to server (default: false)
101
+
transport: {
102
+
enabled: true,
103
+
},
100
104
},
101
105
})
102
106
```
@@ -519,6 +523,40 @@ Review my logging code
519
523
Help me set up logging for this service
520
524
```
521
525
526
+
## Client Transport
527
+
528
+
Send browser logs to your server for centralized logging. When enabled, client-side `log.info()`, `log.error()`, etc. are automatically sent to the server.
Send browser logs to your server for centralized logging. When enabled, client-side `log.info()`, `log.error()`, etc. calls are automatically sent to the server via the `/api/_evlog/ingest` endpoint.
3. Server enriches with environment context (service, version, region, etc.)
191
+
4.`evlog:drain` hook is called with `source: 'client'`
192
+
5. External services receive the log (Axiom, Loki, etc.)
193
+
194
+
::callout{icon="i-lucide-info"color="info"}
195
+
Client logs are automatically enriched with the server's environment context. You don't need to send `service`, `environment`, or `version` from the client.
196
+
::
197
+
198
+
In your drain hook, you can identify client logs by the `source: 'client'` field:
0 commit comments