evloghq/evlog/review-logging-patterns
Claude Code and agent skill by evloghq/evlog
- community
Checking that the SKILL.md file is still in the repository.
Review 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.
Install
npx vskill@latest install evloghq/evlog/review-logging-patternsSKILL.md
The same SKILL.md was published earlier as evloghq/evlog/review-logging-patterns.
Review logging patterns
Review and improve logging patterns in TypeScript/JavaScript codebases. Transform scattered console.logs into structured wide events and convert generic errors into self-documenting structured errors.
When to Use
- Setting up evlog in a new or existing project (any supported framework)
- Reviewing code for logging best practices
- Converting console.log statements to structured logging
- Improving error handling with better context
- Configuring log draining, sampling, or enrichment
Quick Reference
| Working on... | Resource | |
|---|---|---|
| Setup (CLI) | `evlog init`: wire evlog into the project | |
| Project conventions (CLI) | `evlog agents`: write the evlog block into the project's AGENTS.md | |
| Coverage map (CLI) | `evlog map`: score dark entry points | |
| CI gating (CLI) | `evlog map --min-score / --baseline`: gate regressions | |
| Wide events patterns | references/wide-events.md | |
| Error handling | references/structured-errors.md | |
| Code review checklist | references/code-review.md | |
| Drain pipeline | references/drain-pipeline.md | |
| Audit logs | build-audit-logs skill + docs |
Audit logs
For security-sensitive actions (auth, billing, admin, data export), use evlog's audit layer: a typed audit field on wide events, not a parallel logger. See the `build-audit-logs` skill for end-to-end setup (log.audit, withAudit, denials, auditEnricher, auditOnly, signed, mockAudit).
Docs: https://www.evlog.dev/use-cases/audit/overview
Installation
Use the CLI (recommended on Nuxt, Nitro, Next.js, TanStack Start, Hono, Express, Fastify)
The evlog executable ships with the evlog package: pnpm evlog, npx evlog, bunx evlog. It runs @evlog/cli when installed and fetches it on demand otherwise (no dependency added to the project), so it works on a project with nothing yet. Early but worth trying. It reads the project on disk (no traffic, no config needed). On the seven supported frameworks it covers the whole loop: wire evlog in (init), score coverage (map), lock the score in CI (--min-score, --baseline). If the CLI is unavailable, the framework has no adapter yet, or the user declines, continue with the manual sections below; the skill does not depend on it. Ask before installing anything.
1. Setup: evlog init
On a project that doesn't use evlog yet, prefer init over hand-writing the setup, since it detects the framework, reads what the project already has, and generates config, drains, enrichers, and extras in one pass. It is fully scriptable for agents:
Useful flags: --framework (override detection: nuxt, nitro, next, tanstack-start, hono, express, fastify), --prodDrain (comma-separated: axiom, otlp, posthog, sentry, better-stack, datadog, hyperdx, sazabi, loki, clickhouse), --extras (enrichers, pipeline, sampling, vite, error-catalog, audit-catalog, ai, better-auth), --enrichers, --sampling (traffic tier: all, low, medium, high, very-high), --apps (monorepo: which workspace packages), --no-install. Review the --dry-run output with the user before applying. Docs: https://www.evlog.dev/cli/init
2. Score: evlog map
What you get:
- A project score and which entry points are still dark
- FIX FIRST: the three most valuable places to fix
- GOING FURTHER: opportunities (catalogs, audit coverage, AI logging, auth identity) that never cost points
- Per-file inspect:
npx evlog map <file> --no-writeshows the shape the handler could take - Each route is scored on its own handler and the same-file helpers it calls. In an Express, Hono or Fastify routes file, inspect one route with
npx evlog map "GET /users/:id" --no-write - Re-run after fixes and watch the score move
Work FIX FIRST in order, keep changes minimal (useLogger(), log.set(), log.audit(), createError({ why, fix })), then re-run with --no-write. Omit --no-write only when the user wants evlog.map.json written.
3. Lock it in CI: --min-score and --baseline
On GitHub Actions, suggest the evlog action (uses: evloghq/action@v1 with min-score): it scans the pull request base itself, so no map file has to be committed, and puts regressions on the diff and in one comment. The commands below are the same gate from a run: step.
After fixing, propose making the score durable. This is where the CLI earns its keep:
--baseline compares the fresh scan against the committed evlog.map.json, per entry point and per requirement, so a refactor that instruments one route and breaks another fails even if the total score is unchanged. Disabling a passing check with a comment counts as a regression too. New uninstrumented routes are listed as NEW AND DARK without failing. Workflow: commit evlog.map.json once, add the --baseline run to CI, then re-run map without --baseline to accept an intentional change. Docs: https://www.evlog.dev/cli/ci
When the project has an evlog.config.ts, the gate can live there instead of in the CI step: map: { minScore: 80, baseline: true } makes a bare evlog map gate the same way, and a flag still wins. The same map block turns checks off for every entry point (rules: { 'error-catalog': 'off' }) and leaves entry points out by file glob (ignore). The CLI reads these values without running the file, so they must be literals. Docs: https://www.evlog.dev/cli/config
Early days: adapters and rules are still evolving; expect scores to move between releases. Docs: https://www.evlog.dev/cli/map · Rules: https://www.evlog.dev/cli/rules
Framework Setup
Nuxt
useLogger, log, and parseError are auto-imported. createError is not: a bare one resolves to h3's, which drops why, fix, and link. Import it from evlog.
Drain, enrich, sampling and redaction can live in evlog.config.ts at the app root. The module loads it on the server, and the evlog key in nuxt.config.ts overrides it. The browser logger reads only the evlog key.
Nitro hooks in server plugins keep working next to the file, and an event reaches both drains:
Client transport (auto-configured Vue plugin):
Client-side: log, setIdentity, clearIdentity are auto-imported in components.
Next.js
Step 1: Create central config. All exports come from here:
Step 2: Wrap route handlers with withEvlog():
Step 3: Server Actions. Same withEvlog() wrapper:
Step 4: Middleware (optional, sets x-request-id + timing headers):
Step 5: Client Provider. Wrap the root layout:
Step 6: Client logging. In any client component:
Step 7 (optional): Instrumentation. Startup plus global onRequestError (SSR/RSC errors outside withEvlog). Use defineNodeInstrumentation(() => import('./lib/evlog')) in root instrumentation.ts to gate Node + cache the import, or write register/onRequestError manually. Both are valid. For custom logic, wrap evlog’s register/onRequestError inside lib/evlog.ts (compose with your own init or metrics), then re-export.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/review-logging-patterns/SKILL.md
Popularity
- Repository stars
- 1,877
- Repository forks
- 62
- 7-day trend score
- 38
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/evloghq/evlog/review-logging-patterns)