feat: replace LogTape with evlog for wide-event logging - #142
Open
adelrodriguez wants to merge 2 commits into
Open
feat: replace LogTape with evlog for wide-event logging#142adelrodriguez wants to merge 2 commits into
adelrodriguez wants to merge 2 commits into
Conversation
Replace the five @logtape/* packages with evlog in @init/observability.
The facade now exposes createLogger (per-app singleton init), the ambient
log API, structured errors (createError/parseError), a Hono middleware
that emits one wide event per request, a Sentry drain behind a
batching/retry pipeline, Better Auth helpers, and a Vite plugin that
strips log.debug from production builds.
- API: request-scoped wide events via c.var.log/useLogger, user identity
stamped on every authenticated request, structured error responses
- Apps: createLogger({ service }) singletons; Vite apps also get the
evlog plugin
- Packages: Inngest, Drizzle, Convex, and email now log through the
ambient evlog API; category loggers are gone
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Your Pullfrog detected a billing-exhausted response from your provider — the agent stopped before completing this run.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Wire per-request wide events for the app without the evlog Nitro module: a Start request middleware (type: 'request') opens the event, records handler type, server function metadata, and response status, and emits on completion. Registered ahead of CSRF in requestMiddleware so rejected requests are logged too. The facade re-exports createRequestLogger for custom integrations. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Your Pullfrog detected a billing-exhausted response from your provider — the agent stopped before completing this run.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Migrates logging from LogTape (five
@logtape/*packages) to evlog, adopting the wide-event model: instead of scattered log lines, each API request accumulates context and emits one comprehensive event with method, path, request ID, user identity, custom fields, status, and duration.{"method":"GET","path":"/hello","requestId":"73206be7…","user":{"id":"usr_123"},"status":200,"durationMs":3,"level":"info","service":"api"}@init/observabilityfacadelogger—createLogger({ service, drain?, isDevelopment? })for the per-app singleton, the ambientlogAPI for packages, and structured errors (createError/parseErrorwithwhy/fixfields)logger/hono—withRequestLogging()middleware (one wide event per request, exposed asc.var.log),useLogger()for deep call stacks,LoggerVariablescontext typelogger/drains— Sentry drain behind a batching/retry pipeline; no-op whenSENTRY_DSNis unsetlogger/auth— evlog's first-class Better Auth helpers (identifyUser,createAuthMiddleware,maskEmail)logger/vite— evlog Vite plugin: auto-init pluslog.debugstripping from production buildsConsumers
requireSessionstampsuser/sessiononto every authenticated request event;onErrorlogs to the wide event and returns structured{ message, why, fix }responses; Better Auth internal logs route through evlog; tRPC context passeslogthroughcreateLogger({ service })singletons; the Vite-based apps also register the evlog pluginLoggerCategoryandgetLoggerare goneAlso fixes stale Axiom references in the observability README and project-structure doc.
Behavior changes
redact: { paths: [...] }oncreateLoggerif desired.message/why/fix) instead of plain-text 500s..with()/.getChild()) flattened to the plain logger — no downstream consumers existed.Not in this PR
appserver (needs the observability server env imported intoapps/app/.env.schema— follow-up; wide events currently emit to the server console)monitoring/*, unchangedTesting
bun run check(lint + format + types) passesbun test— 22/22 passwithRequestLoggingemits the wide event above, withc.var.log.set()anduseLogger().set()both landing on the same event🤖 Generated with Claude Code
Update
TanStack Start server-side wide events are now included — implemented with a Start request middleware (
withWideEvent,type: "request") instead of the evlog Nitro module. It opens one event per server request (SSR and server function calls), records handler type, server-fn name/file, and response status, and exposes the logger to handlers viacontext.log.