Logging that
makes sense.
Wide events and structured errors for TypeScript. One log per request. Full context. Errors that explain why.
✗Which request failed?✗Who was the user?
Features
Everything you need.
Wide Events
Accumulate context throughout your request. Emit once at the end with everything you need.
log.set({ user: { id, plan } })
log.set({ cart: { items, total } })
// → One event with all contextStructured Errors
Errors that explain why they happened and how to fix them.
throw createError({
message: 'Payment failed',
why: 'Card declined',
fix: 'Try another card',
})Agent-Ready
Structured JSON output that AI agents can parse and understand.
{
"level": "error",
"why": "Card declined",
"fix": "Try another card"
}Nuxt & Nitro
First-class integration. Auto-create loggers, auto-emit at request end.
export default defineNuxtConfig({
modules: ['evlog/nuxt'],
})Smart Sampling
Head and tail sampling. Keep errors and slow requests, reduce noise.
sampling: {
rates: { info: 10, warn: 50 },
keep: [{ status: 400 }]
}Pretty & JSON
Human-readable in dev, machine-parseable JSON in production.
[INFO] POST /api/checkout (234ms)
user: { id: 1, plan: "pro" }
cart: { items: 3 }Simple API
Three lines of code.
Full observability.
checkout.post.ts
export default defineEventHandler(async (event) => {
const log = useLogger(event)
log.set({ user: { id: user.id, plan: user.plan } })
log.set({ cart: { items: 3, total: 9999 } })
return { success: true }
})outputINFO
INFOPOST/api/checkout(234ms)
user: { id: 1842, plan: "pro" }
cart: { items: 3, total: 9999 }
status: 200
requestId: "req_8f2k..."
✓ One log with full context
Structured Errors
Errors that explain why.
payment.post.ts
throw createError({
message: 'Payment failed',
status: 402,
why: 'Card declined by issuer',
fix: 'Try a different card',
})outputERROR
ERRORPOST/api/payment402
message: "Payment failed"
why: "Card declined by issuer"
fix: "Try a different card"
✓ Actionable error messages
Get Started
Stop grep-ing through chaos.
Wide events, structured errors, zero config. Ship with the logging your future self will thank you for.
terminal
$bun add evlog
+ evlog@1.0.0
$cat nuxt.config.ts
export default defineNuxtConfig({
modules: ['evlog/nuxt'],
})✓ Ready. No configuration needed.