Skip to content

feat(logging): structured JSON console logs via RING_LOG_FORMAT#189

Merged
Shine-neko merged 1 commit into
mainfrom
feat/json-console-logging
Jul 7, 2026
Merged

feat(logging): structured JSON console logs via RING_LOG_FORMAT#189
Shine-neko merged 1 commit into
mainfrom
feat/json-console-logging

Conversation

@Shine-neko

Copy link
Copy Markdown
Contributor

What

Adds RING_LOG_FORMAT=json to emit the console logs as structured JSON (one object per line) instead of the default human-readable text. For log shippers and structured ingestion pipelines.

This is independent of OTLP log export ([server.telemetry.logs]), which can run alongside either console format.

Example

RING_LOG_FORMAT=json ring server start | jq 'select(.level == "ERROR")'
{"timestamp":"2026-07-07T12:06:36Z","level":"INFO","fields":{"message":"Starting server..."},"target":"ring::commands::server"}

Unset (or any value other than json) keeps the existing text format, so nothing changes by default.

Changes

  • main.rs: console_fmt_layer() picks the JSON or text fmt layer from RING_LOG_FORMAT; json feature enabled on tracing-subscriber
  • New e2e tests/e2e/server/t19_json_logging.sh: boots the server in JSON mode and asserts the log lines parse as JSON with the expected fields
  • Docs: environment-variables.md (new row), observe-and-debug.md (usage with jq)

Test

./tests/e2e/server/t19_json_logging.sh   # PASS

@Shine-neko Shine-neko force-pushed the feat/json-console-logging branch from 769145e to 27da811 Compare July 7, 2026 12:32
@Shine-neko Shine-neko merged commit 4950c5f into main Jul 7, 2026
5 checks passed
@Shine-neko Shine-neko deleted the feat/json-console-logging branch July 7, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant