-
Notifications
You must be signed in to change notification settings - Fork 167
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
Use Structured Logging #98
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.
structured logging is a nice improvement here.
try | ||
{ | ||
logger.LogTrace("UnlockInstance enter {host}: {redisKey}, {LockId}"); |
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.
Values to log are missing
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.
Please fix placeholder casing. Microsoft recommends to use PascalCase
- should be {Host}
, {RedisKey}
and {LockId}
try | ||
{ | ||
logger.LogTrace("UnlockInstanceAsync enter {host}: {redisKey}, {LockId}", |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Structured logging is the practice of implementing a consistent, predetermined message format for application logs that allows them to be treated as data sets rather than text. The idea of structured logging is to take an application log that is delivered as a string of text and convert it into a simple relational data set that can be more easily searched and analyzed.
https://docs.microsoft.com/pt-br/aspnet/core/fundamentals/logging/?view=aspnetcore-6.0#log-message-template