-
Notifications
You must be signed in to change notification settings - Fork 795
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 severity logging levels, and send errors to syslog/Event Viewer (incl failed rollbacks for confirmed blocks) #1973
Add severity logging levels, and send errors to syslog/Event Viewer (incl failed rollbacks for confirmed blocks) #1973
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending formatting on CI.
On Windows the event log sink could be used, but that can be a separate PR if we want it.
So the event viewer was a bit more of a pain. From the boost docs
Which we don't do, it is a static library. There are also some permissions problems as it needs to create a registry entry which fails unless the node is run as an admin, which we don't enforce. However checking the Event viewer on Windows 10 it still has the correct entry marked as an error. For instance, using using the new cli command (
Which I think is good enough, it still contains the relevant log message. |
Could it print to log file "Error: " as well? |
When the rollback visitor tries to rollback a confirmed block, it currently just outputs to the log file. For greater visibility it now also gets sent to the system logger as priority
error
which should flag up any process monitoring applications.Added
severity_level
to the logging, currently just withnormal
anderror
, where normal is the default unless otherwise specified. The sys log is filtered on equal or greater than theseverity_logging::error
, so that only crucial messages are sent to the sys log on Unix & Event log on Windows.The Unix system logger output
/var/log/syslog
doesn't show priority by default. When testing I followed this page to check that the priority was set correctly. Using the new--debug_sys_logging
CLI command the follow is output:3,1,May 10 13:27:01,ubuntu-s-1vcpu-1gb-lon1-01,nano_node:, Error: 3: Testing system logger
Where 3 is the
error
priority based on RFC5424.