Microsoft.Extensions.Logging.EventId guidelines #53583
Unanswered
BlakeWills
asked this question in
Q&A
Replies: 1 comment
-
cc @shirhatti |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
We're starting to adopt structured logging using the MEL
ILogger
interface and one of the parameters is anEventId
. We can see this being really useful to uniquely identify events that happen within a service.We know that we can define our own id's custom to our service, but there are numerous events that are often logged by every service that we'd like to have common id's for, such as:
This would make it easy for any one to search the logs and know that if they want to find something all completion events in service x, they just need to search for
serviceName==x AND EventId.Id==y
.We'd be interested to know if there are any Microsoft guidelines (even internal design guidelines/policy) on the use of EventId's for common events, just so we don't go and define our own if there's already a standard.
For example,
HttpClient.LogicalHandler
andHttpClient.ClientHandler
both use an id of 100 to denote that an event is starting and 101 for something that is ending. Is this pattern common across other Microsoft libraries and if so what other events do you have common id's for?Apologies if this is already published somewhere, I couldn't find it in the docs.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions