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

Enable (newline-delimited) JSON logging #6660

Closed
wants to merge 2 commits into from

Conversation

andreibancioiu
Copy link
Collaborator

Reasoning behind the pull request

  • Often, it's useful to have a more structure representation of the Node's logs.

Proposed changes

  • Add a JSON formatter mx-chain-logger-go#33
  • Add a new CLI flag: --log-save-json. Logs will be written to a *.jsonl file (new-line delimited JSON).
  • Can be used on its own, or together with --log-save (log files will be paired).

Testing procedure

  • Standard testing
  • Enable only standard file logging, without JSON logging
  • Enable only JSON file logging, without standard file logging
  • Enable both standard file logging and JSON logging

Example of a log line (excerpt from a .jsonl log file):

{"Message":"highest final shard block","LogLevel":1,"Args":["shard","1","nonce","821198"],"Timestamp":1733518032262273416,"LoggerName":"process/block","Correlation":{"Shard":"1","Epoch":685,"Round":822772,"SubRound":"(END_ROUND)"}}

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@andreibancioiu andreibancioiu self-assigned this Dec 6, 2024
Copy link

github-actions bot commented Dec 6, 2024

⚠️ No report was generated due to an error or cancellation of the process.
Please checkout gh action logs for details

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