You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
According to @BrennanConroy eventId's of LoggerMessage.Define should be unique per category (usually the T in ILogger<T>). There's some spots where that's not true and we should fix it. Example of non-uniqueness here.
The category is usually the type name we pass into ILogger<T>. The category names are arbitrary strings, but we pretty much always pass in the type name of the type doing the logging.
In that case isn't this and this as called here and here respectively an example of us not following (category + eventid) uniqueness since they'll use the same _logger?
But this statement has never been a practice we have followed:
EventId's of LoggerMessage.Define should be unique within thier package. This is certainly not the case right now, so we should go through and make them all so.
Ok let's fix this one offending one. I can't think of a good way to easily detect this because there's no way to tell from the various LoggerExtension methods where the log will be used, and thus what the category is.
Activity
rynowak commentedon Apr 3, 2017
Our eventIds are unique per-logger. Where is this new requirement coming from?
Eilon commentedon Apr 11, 2017
Yeah this is news to me. The uniqueness is (category + eventid), not just (eventid).
ryanbrandenburg commentedon Apr 11, 2017
@BrennanConroy did I misunderstand the requirements here? And @Eilon what "category" are you talking about?
Eilon commentedon Apr 11, 2017
The category is usually the type name we pass into
ILogger<T>. The category names are arbitrary strings, but we pretty much always pass in the type name of the type doing the logging.ryanbrandenburg commentedon Apr 11, 2017
In that case isn't this and this as called here and here respectively an example of us not following (category + eventid) uniqueness since they'll use the same _logger?
rynowak commentedon Apr 11, 2017
If we have a bug we should fix it.
But this statement has never been a practice we have followed:
Eilon commentedon Apr 11, 2017
@ryanbrandenburg that does appear to be a specific bug in that specific case.
[-]EventID's should be unique per-package[/-][+]EventID's should be unique per-category[/+]ryanbrandenburg commentedon Apr 11, 2017
Updated to reflect category vs package.
Eilon commentedon Apr 12, 2017
Ok let's fix this one offending one. I can't think of a good way to easily detect this because there's no way to tell from the various LoggerExtension methods where the log will be used, and thus what the category is.
Assign unique event Ids in the logger (#6270)