-
Notifications
You must be signed in to change notification settings - Fork 1k
add log #3881
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
base: master
Are you sure you want to change the base?
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.
Great PR.
Many changes, so need some time to review.
Co-authored-by: Will <[email protected]>
/// </summary> | ||
/// <param name="logger">The Serilog logger instance</param> | ||
/// <returns>A collection of sink objects</returns> | ||
public static IEnumerable<object> GetSinks(this ILogger logger) |
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.
It looks weird.
Why get some prive members?
@@ -56,14 +60,23 @@ internal class Close { public bool Abort; } | |||
/// <param name="local">The address of the local node.</param> | |||
protected Connection(object connection, IPEndPoint remote, IPEndPoint local) | |||
{ | |||
// Initialize logger in constructor since we need the dynamic values | |||
_log = Log.ForContext(GetType()).ForContext("Remote", remote).ForContext("Local", local); | |||
_log?.Debug("Connection actor created"); |
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.
Why so many _log?
, and why not _log
directly?
If the log is not needed, just set it to a noop log?
Description
This PR integrates Serilog as a structured logging system for the Neo blockchain. The implementation provides enhanced logging capabilities with improved readability, flexibility, and diagnostic capabilities over the current logging system.
Key features implemented:
This change enhances observability of the node's behavior during normal operation and significantly improves diagnostic capabilities during troubleshooting sessions.
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: