-
Notifications
You must be signed in to change notification settings - Fork 20.5k
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
Logging in JSON format #21926
Comments
Regarding the file output, you can easily rediect the output. Actually in a very old version Geth, it's supported to dump the log to files. While we think it's totally unecessary. |
Just a few weeks ago I started to look at patching a local build of geth to support this. This seems like a great feature. :-) |
Hi @rjl493456442, I currently use redirectors to save the log into a file. But the JSON format logging could it's a good candidate for a feature. |
Not to mention that support for log redirection stuff is terrible in Windows, and when used with something like systemd and journalctl - breaking out stderr and stdout is harder to do, and if you want to syslog stuff it's also hard to get levels correct. There's multiple instances of people patching geth themselves to support log files because of the assumption that redirecting output is good enough 🙁 |
This is what
|
Rationale
There should be more options on logging format for Geth.
At the moment, the only option available is the verbosity level.
For example, logging parsing is a great tool for managing highly available nodes.
I am suggesting two flags, one that would change the formatted log to JSON and a second flag to specify the output log file, rather than dump onto
stdout
.These two flags combined would allow a variety of tools to monitor the health of a Geth node.
Implementation
The
log/
folder, containing thelog15
package already parses the log messages in JSON format, but it converts to syslog before dumping. The first mentioned flag would skip the conversation.Also, it's (to my knowledge) trivial to create a flag that receives one argument (file) and writes the log into it rather than
stdout
.The text was updated successfully, but these errors were encountered: