/evlog:analyze-logsfrom evlog
Reads and analyzes structured NDJSON wide-event logs from .evlog/logs/ directory. Use when debugging errors, investigating slow requests, understanding request patterns, or answering questions about application behavior.
Ships in evlog. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Read and analyze structured wide-event logs from the local .evlog/logs/ directory to debug errors, investigate performance issues, and understand application behavior.
Try the CLI first; it reads both file layouts, every dated file, and knows where the project's drain writes. Prefer the copy the project installed (pnpm evlog, or the equivalent for its package manager). The wrappers that fetch on demand (npx, bunx, npm exec) install @evlog/cli when the project has none, which runs a release the lockfile never pinned. Ask before that happens.
pnpm evlog logs --json # the last 50 events
pnpm evlog logs errors --since 1h --json # what failed
pnpm evlog logs slow --over 1s --json # what was slow, worst first
pnpm evlog logs "$REQUEST_ID" --json # one request, every event with that id
pnpm evlog logs stats --json # per route: count, errors, p50, p95; by status and level
pnpm evlog logs --where 'payment.amount>5000' --where audit.outcome=failure --json
--json is an envelope (sources, view, matched, events; stats carries stats instead); filters are --since, --until, --level, --path, --status (500 or 5xx), --where field=value|field>n|field~regex|field|!field on any dotted field (repeatable), --limit, --dir for a non-default directory, and --url for an app on the memory drain that exposes readMemoryLogs() over HTTP. From a monorepo root it reads every app's .evlog/logs and labels each event. Docs: https://www.evlog.dev/cli/logs. If the CLI is unavailable or the user declines it, read the files directly as below.
Logs are written by evlog's file system drain as .jsonl files, organized by date.
Format detection: The drain supports two modes:
pretty: false): One compact JSON object per line. Parse line-by-line.pretty: true): Multi-line indented JSON per event. Parse by reading the entire file and splitting on top-level objects (e.g. JSON.parse('[' + content.replace(/\}\n\{/g, '},{') + ']')) or use a streaming JSON parser.Always check the first few bytes of the file to detect the format: if the second character is a newline or ", it's NDJSON; if it's a space or newline followed by spaces, it's pretty-printed.
Search order. Check these locations relative to the project root:
.evlog/logs/ (default).evlog/logs/ inside app directories (monorepos: apps/*/.evlog/logs/)Use glob to find log files:
.evlog/logs/*.jsonl
*/.evlog/logs/*.jsonl
apps/*/.evlog/logs/*.jsonl
Files are named by date: 2026-03-14.jsonl. Start with the most recent file.
Programmatic reading: instead of hand-parsing, a small script can use the readers shipped with evlog: readFsLogs() and tailFsLogs() from evlog/fs are async generators that handle both formats, date ordering, and filtering. Prefer them when the project already has evlog installed and the analysis needs more than a quick grep.
Memory drain alternative: some apps use the Memory adapter (evlog/memory) instead of (or alongside) the FS drain, exposing recent events through a dev-only HTTP endpoint via readMemoryLogs(). If .evlog/logs/ is empty but the app wires createMemoryDrain(), query that endpoint instead.
Before wiring a new drain, you can try npx evlog doctor --json, which checks whether evlog is installed and whether a local .evlog/logs drain already exists (read-only). Optional; skip if the CLI is unavailable.
The file system drain may not be enabled. On Nuxt, Nitro, Next.js, TanStack Start, Hono, Express, or Fastify, the fastest path is the CLI, which detects the framework and wires the fs drain (its default dev drain) in one pass:
npx evlog init --dry-run --yes # preview first
npx evlog init --yes --drain fs # apply
Ask before running it. On other frameworks (or if the user declines), guide the manual setup:
import { defineEvlog } from 'evlog'
import { createFsDrain } from 'evlog/fs'
// Nuxt / Nitro: evlog.config.ts at the app root, which the module loads
export default defineEvlog({ drain: createFsDrain() })
// Hono / Express / Elysia: pass in middleware options
app.use(evlog({ drain: createFsDrain() }))
// Fastify: pass in plugin options
await app.register(evlog, { drain: createFsDrain() })
// NestJS: pass in module options
EvlogModule.forRoot({ drain: createFsDrain() })
// Standalone: pass to initLogger
initLogger({ drain: createFsDrain() })
After setup, the user needs to trigger some requests to generate logs, then re-analyze.
Each line is a self-contained JSON object (wide event). Key fields:
| Field | Type | Description |
|---|---|---|
timestamp | string | ISO 8601 timestamp |
level | string | info, warn, error, debug |
service | string | Service name |
environment | string | development, production, etc. |
method | string | HTTP method (GET, POST, etc.) |
path | string | Request path (/api/checkout) |
status | number | HTTP response status code |
duration | string | Request duration, human-formatted ("234ms") |
durationMs | number | Request duration in milliseconds. Filter and sort on this one |
requestId | string | Unique request identifier |
error | object | Error details: name, message, stack, statusCode, data |
error.data.why | string | Human-readable explanation of what went wrong |
error.data.fix | string | Suggested fix for the error |
source | string | client for browser logs, absent for server logs |
userAgent | object | Parsed browser/OS/device info |
All other fields are application-specific context added via log.set() (e.g. user, cart, payment).
Read the latest .jsonl file. Each line is one JSON event. Parse each line independently.
Filter based on the user's question:
"level" of "error" or "fatal", status >= 500, or an error object on the event, which is what evlog logs errors matches. A 4xx status on its own is the client's and does not count, though a 4xx event still matches when it carries one of the other two signals; read status or pass --status 4xx to see them allpathdurationMs (e.g. durationMs > 500)"source":"client"timestamp valuesFor each relevant event:
path, method, status, levelerror.message, error.data.why, and the stack traceerror.data.fix for suggested remediationFilter: level === "error"
Group by: error.message or path
Look for: recurring patterns, common failure modes
Filter: durationMs > 1000
Sort by: durationMs descending
Look for: specific endpoints, time-of-day patterns
Filter: requestId === "the-request-id"
Result: single wide event with all context for that request
Group events by: path
Count: total events vs error events per path
Look for: endpoints with high error ratios
Split by: source === "client" vs no source field
Compare: error patterns between client and server
Look for: client errors that don't have corresponding server errors (network issues)
error.data.why and error.data.fix fields are evlog-specific structured error fields. When present, they provide the most actionable information.duration is human-formatted with units (e.g. "706ms"). durationMs is the same duration in milliseconds; filter and sort on durationMs."source":"client" originated from browser-side logging and were sent to the server via the HTTP drain endpoint..gitignore'd automatically. They exist only on the local machine or server where the app runs.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub pleaseai/claude-code-plugins --plugin evlog3 skills in this plugin
/build-audit-logsBuild or review audit trails in TypeScript/JavaScript apps using evlog (pipelines, typed actions, denials, retention, compliance-style reviews). For application code, not for extending the evlog package./review-logging-patternsReview code for logging patterns and suggest evlog adoption. Optionally use the evlog CLI, shipped with the evlog package (`evlog init` to wire evlog, `evlog agents` to write the conventions into AGENTS.md, `evlog map` to score entry-point coverage, `--baseline` to gate regressions in CI) on Nuxt, Nitro, Next.js, TanStack Start, Hono, Express, and Fastify. Guides setup on those plus SvelteKit, React Router, NestJS, Express, Fastify, Elysia, oRPC, Effect, Cloudflare Workers, AWS Lambda, Astro, and standalone TypeScript. Detects console.log spam, unstructured errors, and missing context. Covers wide events, structured errors, drain adapters (Axiom, OTLP, HyperDX, Sazabi, PostHog, Sentry, Better Stack, Datadog, Loki, ClickHouse, NuxtHub, Memory), sampling, enrichers, and AI SDK integration.Other plugins' skills for the same job