Skip to content

Add structured logging with log levels across all layers #8

Closed

Description

@morluto

Motivation

REA currently has no logging infrastructure (pino, winston, etc.). Adding structured logging would improve debuggability of MCP sessions, bridge communication, and CLI operations. It also enables log scrubbing and observability integrations down the line.

Proposed Changes

  1. Add pino (lightweight, fast structured JSON logger) as a dependency
  2. Create src/logger.ts with:
    • Log level configuration (trace/debug/info/warn/error/fatal)
    • Per-layer child loggers with context (server, bridge, cli, domain)
    • Redacted sensitive data support
  3. Integrate logging into:
    • Bridge client request/response cycles (with timing)
    • MCP tool execution (tool name, duration, result status)
    • CLI one-shot commands
    • Error boundaries
  4. Output to stderr in MCP mode (per MCP spec) and stdout in CLI mode

Acceptance Criteria

  • All layers have structured log output in JSON format
  • Log level is configurable via environment variable
  • MCP mode logs to stderr without interfering with stdio transport
  • Bridge request/response timing is logged
  • No secrets or sensitive data in log output

Activity

  1. added
    enhancement
    P3: low
    area: bridge
    area: cli
    area: server
    on Jul 12, 2026
  2. added a commit that references this issue on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3: lowarea: bridgearea: cliarea: serverenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions