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
- Replace
appendFileSync with pino's multi-transport using targets array for async file writing via worker threads
- Add log rotation via
pino-roll (daily rotation, keep 7 days)
- Use pino child loggers instead of the custom
createScopedLogger wrapper
- 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
Problem
apps/mcp-server/src/logger.tsdouble-logs everything — once via pino (stderr) and once via synchronousappendFileSync. The sync file I/O blocks the Node.js event loop on every log call.Solution
appendFileSyncwith pino's multi-transport usingtargetsarray for async file writing via worker threadspino-roll(daily rotation, keep 7 days)createScopedLoggerwrapperlogger.info({ tool, duration }, 'Tool completed')Files
apps/mcp-server/src/logger.ts— rewrite logging infrastructure