/research_codebase im just thinking right now for @vendor/observability/src/inngest.ts…
- User
/research_codebase im just thinking right now for @vendor/observability/src/inngest.ts @vendor/observability/src/trpc.ts should we introduce something like pino or something more for strcutured logging.
- User
research_codebase /research_codebase im just thinking right now for @vendor/observability/src/inngest.ts @vendor/observability/src/trpc.ts should we introduce something like pino or something more for strcutured logging.
Assistant· claude-opus-4-6
I've read both files. Now let me research the full logging infrastructure to understand what exists today.
Assistant· claude-opus-4-6
Good, I have a comprehensive picture. Let me gather the remaining context and metadata.
Assistant· claude-opus-4-6
Now let me write the research document.
Assistant· claude-opus-4-6
Here's the picture:
Your current system is already doing structured logging in production. Every
log.*call flows through a 28-line wrapper (log/next.ts) that:- Merges ALS context (requestId, traceId, auth fields) into metadata automatically
- Pushes to an in-memory request journal (50-entry cap)
- Ships structured JSON to BetterStack via
@logtail/next
The tRPC and Inngest middlewares both seed the ALS store, so all downstream
log.*calls get enriched without manual threading — conceptually the same as pino's but via AsyncLocalStorage.- User
hmm, im pretty sure logtail allows pine transport.
Assistant· claude-opus-4-6
You're right.
@logtail/pino(v0.5.8) is an official Better Stack pino transport — first-party, actively maintained, ~64K weekly downloads.What this means for your setup:
The migration path would be clean. Instead of the current
@logtail/next→consolefallback inlog/next.ts, you'd instantiate pino with@logtail/pinoas the transport:tsimport pino from "pino"; const logger = pino({ transport: { target: "@logtail/pino", options: { sourceToken: env.BETTERSTACK_SOURCE_TOKEN, options: { endpoint: env.BETTERSTACK_INGESTING_HOST }, }, }, });