diff --git a/apps/docs/content/4.integrate/frameworks/00.overview.md b/apps/docs/content/4.integrate/frameworks/00.overview.md index 59127207..44735773 100644 --- a/apps/docs/content/4.integrate/frameworks/00.overview.md +++ b/apps/docs/content/4.integrate/frameworks/00.overview.md @@ -25,7 +25,7 @@ No HTTP framework? Use [Standalone TypeScript](/integrate/frameworks/standalone) | [React Router](/integrate/frameworks/react-router) | `evlog/react-router` | Middleware | `context.get(loggerContext)` / `useLogger()` | Stable | | [NestJS](/integrate/frameworks/nestjs) | `evlog/nestjs` | Module | `useLogger()` | Stable | | [Express](/integrate/frameworks/express) | `evlog/express` | Middleware | `req.log` / `useLogger()` | Stable | -| [Hono](/integrate/frameworks/hono) | `evlog/hono` | Middleware | `c.get('log')` | Stable | +| [Hono](/integrate/frameworks/hono) | `evlog/hono` | Middleware | `c.get('log')` / `useLogger()` | Stable | | [Fastify](/integrate/frameworks/fastify) | `evlog/fastify` | Plugin | `request.log` / `useLogger()` | Stable | | [Elysia](/integrate/frameworks/elysia) | `evlog/elysia` | Plugin | `log` (context) / `useLogger()` | Stable | | [oRPC](/integrate/frameworks/orpc) | `evlog/orpc` | Handler wrapper + middleware | `context.log` / `useLogger()` | Stable | @@ -54,8 +54,8 @@ Two things differ per framework: how you **bootstrap** evlog, and how you **acce | Pattern | Frameworks | |---------|------------| | `useLogger(event)` | Nuxt, Nitro | -| `useLogger()` | Next.js, NestJS, Express, Fastify, Elysia, SvelteKit, React Router | -| `c.get('log')` | Hono — no `useLogger()` export | +| `useLogger()` | Next.js, NestJS, Express, Fastify, Elysia, SvelteKit, React Router, Hono | +| `c.get('log')` | Hono | | `req.log` | Express | | `request.log` | Fastify | | `event.locals.log` | SvelteKit | @@ -63,7 +63,7 @@ Two things differ per framework: how you **bootstrap** evlog, and how you **acce | `createRequestLogger()` / `createLogger()` | Standalone, Workers, manual setups | ::callout{icon="i-lucide-info" color="info"} -Hono intentionally has no `useLogger()` — use `c.get('log')` inside handlers. See [Hono integration](/integrate/frameworks/hono). +On Hono, use `c.get('log')` inside handlers and `useLogger()` from `evlog/hono` in the layers underneath. See [Hono integration](/integrate/frameworks/hono). :: ## Full-Stack Frameworks diff --git a/apps/docs/content/7.reference/1.configuration.md b/apps/docs/content/7.reference/1.configuration.md index d7b5b61e..92e0cbca 100644 --- a/apps/docs/content/7.reference/1.configuration.md +++ b/apps/docs/content/7.reference/1.configuration.md @@ -104,15 +104,15 @@ See [Structured Errors — Development terminal output](/learn/structured-errors ### Environment Context -The `env` option controls the fields included in every log event. Most values are auto-detected from environment variables and `package.json`. +The `env` option controls the fields included in every log event. Most values are auto-detected from environment variables. | Field | Type | Default | Auto-detected from | |-------|------|---------|-------------------| -| `service` | `string` | `'app'` | `SERVICE_NAME`, `package.json` name | +| `service` | `string` | `'app'` | `SERVICE_NAME` | | `environment` | `string` | `'development'` | `NODE_ENV` | -| `version` | `string` | `undefined` | `APP_VERSION`, `package.json` version | -| `commitHash` | `string` | `undefined` | `COMMIT_SHA`, `GIT_COMMIT`, `VERCEL_GIT_COMMIT_SHA` | -| `region` | `string` | `undefined` | `FLY_REGION`, `AWS_REGION`, `VERCEL_REGION` | +| `version` | `string` | `undefined` | `APP_VERSION` | +| `commitHash` | `string` | `undefined` | `COMMIT_SHA`, `GITHUB_SHA`, `VERCEL_GIT_COMMIT_SHA`, `CF_PAGES_COMMIT_SHA` | +| `region` | `string` | `undefined` | `VERCEL_REGION`, `AWS_REGION`, `FLY_REGION`, `CF_REGION` | ### Silent Mode diff --git a/apps/docs/skills/build-audit-logs/SKILL.md b/apps/docs/skills/build-audit-logs/SKILL.md index 11211a88..11e4766a 100644 --- a/apps/docs/skills/build-audit-logs/SKILL.md +++ b/apps/docs/skills/build-audit-logs/SKILL.md @@ -225,13 +225,16 @@ Three patterns, in order of preference: ```ts import { withAudit, AuditDeniedError } from 'evlog' -export const refundInvoice = withAudit({ - action: 'invoice.refund', - target: ({ id }: { id: string }) => ({ type: 'invoice', id }), -})(async ({ id }, ctx) => { - if (!ctx.actor) throw new AuditDeniedError('Anonymous refund denied') - return db.invoices.refund(id) -}) +export const refundInvoice = withAudit( + { + action: 'invoice.refund', + target: ({ id }: { id: string }) => ({ type: 'invoice', id }), + }, + async ({ id }, ctx) => { + if (!ctx.actor) throw new AuditDeniedError('Anonymous refund denied') + return db.invoices.refund(id) + }, +) ``` Outcome resolution: diff --git a/apps/docs/skills/review-logging-patterns/SKILL.md b/apps/docs/skills/review-logging-patterns/SKILL.md index 020401ae..1ff601a5 100644 --- a/apps/docs/skills/review-logging-patterns/SKILL.md +++ b/apps/docs/skills/review-logging-patterns/SKILL.md @@ -938,7 +938,7 @@ All options work in Nuxt (`evlog` key), Nitro (passed to `evlog()`), Next.js (`c | ClickHouse | `evlog/clickhouse` | `CLICKHOUSE_ENDPOINT`, optional `CLICKHOUSE_USER` / `CLICKHOUSE_PASSWORD` / `CLICKHOUSE_DATABASE` / `CLICKHOUSE_TABLE` | | File System | `evlog/fs` | None (local file system) | | Memory | `evlog/memory` | None (in-process ring buffer; optional `EVLOG_MEMORY_STORE`, `EVLOG_MEMORY_MAX_EVENTS`). Read back with `readMemoryLogs()` — ideal for dev-only log endpoints agents can query | -| NuxtHub | `@evlog/nuxthub` (separate package, Nuxt module) | None — stores wide events in the NuxtHub database with retention-based cleanup (`evlog.nuxthub: { retentionDays, batchSize }`) | +| NuxtHub | `@evlog/nuxthub` (separate package, Nuxt module) | None — stores wide events in the NuxtHub database with retention-based cleanup (set `evlog.retention: '7d'` in the module options; accepts `d`/`h`/`m`) | | HTTP (browser ingest) | `evlog/http` | None (configure `endpoint` in code). `evlog/browser` is deprecated; same API, removed next major | Use canonical env var names (e.g. `AXIOM_API_KEY`, `BETTER_STACK_API_KEY`) — the same names work in every framework.