Repository navigation
Add logging policy #5299
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
Add logging policy #5299
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -150,6 +150,27 @@ We're currently experimenting with hosting the majority of lodestar packages and | |
| - Error: One or more main functionalities are not working, preventing some functions from working properly. | ||
| - Fatal: One or more main functionalities are not working and preventing the application from fulfilling its duties. | ||
|
|
||
| ## Logging policy | ||
|
|
||
| ### Logging Levels | ||
|
|
||
| - `error`: Critical issues that prevent the application from functioning correctly or cause significant disruption to users. Examples include failed network connections, crashes, or data corruption. | ||
|
dapplion marked this conversation as resolved.
Resolved
|
||
| - `warn`: Situations that may lead to critical issues if not addressed but do not prevent the application from functioning. Examples include configuration issues, deprecated features, or temporary network disruptions. | ||
| - `info`: General sporadic informational about the node's state. Examples include initialization messages, infrequent periodic status updates, or high-level progress reports. | ||
| - `verbose`: _TBD_ | ||
|
dapplion marked this conversation as resolved.
Resolved
|
||
| - `debug`: Detailed diagnostic information that can help developers or users troubleshoot specific issues. Examples include individual request logs for every REST API, networking interactions, or internal components status changes. | ||
|
|
||
| ### Guideliness | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like we need a guideline about when/where to include a stack trace
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good point. How could we summarize it? I would say that when the error message provides all possible location information the stack trace can be omitted. We do not support suppressing stack traces out of the box, and the uncontrolled nature of Javascript exceptions could be an issue if we start omitting stack traces. very relevant to this topic https://www.youtube.com/watch?v=6cap2HiBFVQ
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we ok with not adding a bit more details about stack traces? I think the
Not including the stack trace of course can come with a cost of not being able to easily debug an issue but this should be rarely the case if we are careful to only do it for some errors but let's not forget the cost of including the stack trace in terms of UX. Not being able to easily read the logs because of too much stack trace is also not ideal. I would argue that
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just approved the PR so this didn't sit for too long. Happy to merge more verbiage about when stack traces are acceptable. Totally agree with your comment.
dapplion marked this conversation as resolved.
Resolved
|
||
|
|
||
| 1. Always use the appropriate log level as defined above. Log messages should be clear and concise, providing enough information to understand the context and severity of the issue. | ||
|
dapplion marked this conversation as resolved.
Resolved
|
||
| 2. Avoid excessive logging. Log only the information that is necessary for understanding and troubleshooting issues. Over-logging can make it more difficult for users to find relevant information. | ||
| 3. Do not log sensitive data, such as private keys, user credentials, or personal information. | ||
| 4. Do not log arbitrary data from the network as ASCII or UTF8 at levels higher or equal to the current default level. | ||
|
dapplion marked this conversation as resolved.
Resolved
|
||
| 5. Use clear and concise language. Prefer to log variables in JSON format `log.debug("Action", {slot})` instead of formating the text yourself `log.debug('slot=${slot}')`. | ||
|
dapplion marked this conversation as resolved.
Resolved
|
||
| 6. Include only relevant context in log messages, sufficient to debug the issue or action it refers to. | ||
|
|
||
| Contributors must chose the log level carefully to ensure a consistent experience for every type of user: | ||
|
dapplion marked this conversation as resolved.
Resolved
|
||
|
|
||
| ## Contributing to Grafana dashboards | ||
|
|
||
| To edit or extend an existing Grafana dashboard with minimal diff: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.