Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structured Logging for Multi-Geth #23

Open
meowsbits opened this issue Feb 19, 2020 · 2 comments
Open

Structured Logging for Multi-Geth #23

meowsbits opened this issue Feb 19, 2020 · 2 comments

Comments

@meowsbits
Copy link
Member

meowsbits commented Feb 19, 2020

Migrated from: etclabscore/multi-geth-fork#41
Original author: @zcstarr


Although the standard log system installed uses log15 key/value log lines, notably lacking is:

a reliable API for log lines
... and documentation for them
optional JSON log line formatting
The comparison might be made here to ethereumclassic/go-ethereum's mlog feature.

Specs:

Should use the pre-existing log system (which it's set up for; just add a log Handler)
Should support options for key/value and JSON formats
Should NOT write to any file; output should go to stdout (different from existing log lines which rightfully use stderr). They should use stderr because they can be considered "intended and purposeful program output" rather than incidental since turning them on requires an opt-in flag and the information they contain can be considered "program output" (as opposed to the existing logs' "incidental" nature). I'd like to have a discussion about this point and be sure to walk all the way around the reasoning here before diving in.
Should use a prefix to identify structured log lines from "normal" log lines, enabling simple grepping and piping
Should be able to provide thorough and accurate documentation for themselves (self-discovering/documenting code, eg. mdoc)
I think in general the scope of mlog is adequate, and I can't think of anything I'd prefer to leave out.

For reference this is a repost of this issue: multi-geth/multi-geth#33

@ziogaschr
Copy link
Member

From the upstream release v1.10.0 release notes I found this one ethereum/go-ethereum#22207. Is this what we want on this issue @meowsbits ?

@meowsbits
Copy link
Member Author

Definitely a step in the direction. This PR adds a flag toggling the built-in JSON log formatter.

I'd say the critical piece missing is treating the log lines (or a subset of them) like an actual API. To do so, I'd say that what's missing still is

  • a spec defining which log lines are considered as API-level (and so should not be expected to change without warning)
  • documentation describing this set of lines and their behavior/meaning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants