Skip to content

Add ENV var to use JSON logging #4498

@quiet-node

Description

@quiet-node

Problem

Currently, the JSON-RPC relay always uses pino-pretty for log formatting, which outputs human-readable, colorized logs. While this is excellent for local development and debugging, it creates challenges in production environments:

  1. Log aggregation systems (Elasticsearch, Splunk, Datadog, etc.) work best with structured JSON logs
  2. Automated log parsing is difficult with pretty-formatted output
  3. Container orchestration platforms (Kubernetes, Docker Swarm) typically expect JSON-formatted logs
  4. Performance overhead - pino-pretty adds processing time that isn't necessary in production

The relay currently has no way to disable pretty logging in favor of native JSON output.

Proposed Solution

Add a new environment variable PRETTY_LOGS_ENABLED that allows operators to toggle between pretty-printed and JSON-formatted logging.

Metadata

Metadata

Assignees

No one assigned

    Labels

    internalFor changes that affect the project's internal workings but not its outward-facing functionality.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions