
Review Logging Patterns
Audit TypeScript/JavaScript logging and roll out evlog wide events, structured errors, and drain adapters before production traffic.
Overview
Review Logging Patterns is an agent skill most often used in Ship (also Build integrations, Operate monitoring) that reviews TypeScript/JavaScript code for logging anti-patterns and guides evlog adoption with wide events
Install
npx skills add https://github.com/hugorcd/evlog --skill review-logging-patternsWhat is this skill?
- Framework setup guides for Nuxt, Next.js, SvelteKit, Nitro, TanStack Start, React Router, NestJS, Express, Hono, Fastify
- Wide events and structured error patterns with reference docs for errors and enrichment
- Drain adapters for Axiom, OTLP, HyperDX, PostHog, Sentry, and Better Stack
- Sampling, enrichers, and AI SDK metrics (token usage, tool calls, streaming)
- Converts console.log noise into self-documenting structured logging
- 15+ supported frameworks and runtimes listed in the skill description
- 6 named drain backends (Axiom, OTLP, HyperDX, PostHog, Sentry, Better Stack)
Adoption & trust: 698 installs on skills.sh; 1.4k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your app logs with console.log and generic thrown errors, so production debugging and log drains never get consistent, queryable context.
Who is it for?
Indie SaaS and API builders on supported JS/TS frameworks who are standardizing on evlog before scale or after a noisy-logging audit.
Skip if: Teams that only want dependency upgrades with no logging refactor, or codebases outside the supported framework list with no standalone TypeScript entry path.
When should I use this skill?
Setting up evlog in a new or existing project, reviewing logging best practices, converting console.log to structured logging, improving error context, or configuring draining, sampling, or enrichment.
What do I get? / Deliverables
You get a concrete evlog-oriented remediation plan—wide events, structured errors, and optional drain/sampling/AI SDK hooks—ready to implement across your chosen framework.
- Logging audit findings (console spam, unstructured errors, missing context)
- evlog adoption and drain configuration recommendations
- Pointers to wide-event and structured-error reference patterns
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Ship because the skill is invoked as a quality pass on existing code—console spam, unstructured errors, and missing context—right before or after merge, not as greenfield scaffolding. Review subphase matches PR- and codebase-audit workflows: detect anti-patterns and prescribe evlog adoption instead of one-off console fixes.
Where it fits
Bootstrap evlog and drain adapters while adding your first API route on NestJS or Hono.
Run a logging-focused review on a PR that still uses console.log for auth and payment paths.
Tune sampling, enrichers, and AI SDK token metrics after users report unclear production errors.
How it compares
Use instead of ad-hoc “replace console.log” chat advice when you want framework-specific evlog setup and structured error patterns in one skill.
Common Questions / FAQ
Who is review-logging-patterns for?
Solo and indie builders on TypeScript/JavaScript stacks (Nuxt, Next, SvelteKit, Nest, Express, Hono, Workers, and others listed in the skill) who want structured logging and evlog before or after shipping.
When should I use review-logging-patterns?
During Build when wiring integrations and first observability hooks; during Ship when reviewing PRs for logging best practices; during Operate when improving error context, drains, sampling, or AI SDK metrics after launch.
Is review-logging-patterns safe to install?
Treat it like any third-party skill: read what your agent will change in-repo and review the Security Audits panel on this Prism page before enabling automated refactors.
SKILL.md
READMESKILL.md - 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 | | ----------------------- | ------------------------------------------------------------------ | | Wide events patterns | [references/wide-events.md](references/wide-events.md) | | Error handling | [references/structured-errors.md](references/structured-errors.md) | | Code review checklist | [references/code-review.md](references/code-review.md) | | Drain pipeline | [references/drain-pipeline.md](references/drain-pipeline.md) | ## Installation ```bash npm install evlog ``` --- ## Framework Setup ### Nuxt ```typescript // nuxt.config.ts export default defineNuxtConfig({ modules: ['evlog/nuxt'], evlog: { env: { service: 'my-app' }, include: ['/api/**'], }, }) ``` All evlog functions (`useLogger`, `createError`, `parseError`, `log`) are **auto-imported** — no import statements needed. ```typescript // server/api/checkout.post.ts — no imports needed export default defineEventHandler(async (event) => { const log = useLogger(event) log.set({ user: { id: user.id, plan: user.plan } }) return { success: true } }) ``` Drain, enrich, and tail sampling use Nitro hooks in server plugins: ```typescript // server/plugins/evlog-drain.ts import { createAxiomDrain } from 'evlog/axiom' export default defineNitroPlugin((nitroApp) => { nitroApp.hooks.hook('evlog:drain', createAxiomDrain()) }) ``` Client transport (auto-configured Vue plugin): ```typescript // nuxt.config.ts evlog: { transport: { enabled: true }, // logs sent to /api/_evlog/ingest } ``` Client-side: `log`, `setIdentity`, `clearIdentity` are auto-imported in components. ### Next.js **Step 1: Create central config** — all exports come from here: ```typescript // lib/evlog.ts import type { DrainContext } from 'evlog' import { createEvlog } from 'evlog/next' import { createUserAgentEnricher, createRequestSizeEnricher } from 'evlog/enrichers' import { createDrainPipeline } from 'evlog/pipeline' const enrichers = [createUserAgentEnricher(), createRequestSizeEnricher()] const pipeline = createDrainPipeline<DrainContext>({ batch: { size: 50, intervalMs: 5000 } }) const drain = pipeline(createAxiomDrain({ dataset: 'logs', token: process.env.AXIOM_TOKEN! })) export const { withEvlog, useLogger, log, createError } = createEvlog({ service: 'my-app', sampling: { rates: { info: 10 }, keep: [{ status: 400 }, { duration: 1000 }], }, routes: { '/api/auth/**': { service: 'auth-service' }, '/api/checkout/**': { service: 'checkout-service' }, }, keep: (ctx) => { const user = ctx.context.user as { premium?: boolean } | undefined if (user?.premium) ctx.shouldKeep = true }, enrich: (ctx) => { for (const enricher of enrichers) enricher(ctx) }, d