Skip to content

Fix Pino Logger Double-Logging and Sync I/O #35

Description

@foxintheloop

Problem

apps/mcp-server/src/logger.ts double-logs everything — once via pino (stderr) and once via synchronous appendFileSync. The sync file I/O blocks the Node.js event loop on every log call.

Solution

  1. Replace appendFileSync with pino's multi-transport using targets array for async file writing via worker threads
  2. Add log rotation via pino-roll (daily rotation, keep 7 days)
  3. Use pino child loggers instead of the custom createScopedLogger wrapper
  4. Follow pino convention: data as first arg, message as second: logger.info({ tool, duration }, 'Tool completed')

Files

  • apps/mcp-server/src/logger.ts — rewrite logging infrastructure

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions