google / google/sam

Add a opt-in mechanism to make the node output logs in JSON format

Open
#332 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
846
Forks
128
Avg merge
23h 7m
Merged PRs (30d)
88

Description

Add a opt-in mechanism to make the node output logs in JSON format (GOLOG_LOG_FMT=json / cfg.Format) instead of the console encoder.

Points to weigh:

* Machine consumers of the debug command get whole-line JSON, no console-format parsing needed. journalctl / terminal readability suffers; operators would need jq or GOLOG_LOG_FMT=color to read logs comfortably.
* Middle ground worth exploring: per-sink encoders - JSON for the ringbuffer:// sink (what tools consume), console for stderr (what humans read). go-log configures one format globally, so this needs a custom zap core wiring in main.go.

Contributor guide

Open the contributing guide

Research direction

Start in main.go and trace how go-log configures cfg.Format and the ringbuffer:// and stderr sinks used by the node and debug command. Compare the global GOLOG_LOG_FMT=json option with the proposed per-sink behavior, then verify that machine consumers receive whole-line JSON while terminal output remains readable or can use GOLOG_LOG_FMT=color.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, observability-sre
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.