Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

EventID's should be unique per-category #6062

Closed

Description

@ryanbrandenburg

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.

Activity

  1. rynowak commented on Apr 3, 2017

    @rynowak
    Contributor

    Our eventIds are unique per-logger. Where is this new requirement coming from?

  2. Eilon commented on Apr 11, 2017

    @Eilon
    Contributor

    Yeah this is news to me. The uniqueness is (category + eventid), not just (eventid).

  3. ryanbrandenburg commented on Apr 11, 2017

    @ryanbrandenburg
    ContributorAuthor

    @BrennanConroy did I misunderstand the requirements here? And @Eilon what "category" are you talking about?

  4. Eilon commented on Apr 11, 2017

    @Eilon
    Contributor

    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.

  5. ryanbrandenburg commented on Apr 11, 2017

    @ryanbrandenburg
    ContributorAuthor

    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?

  6. rynowak commented on Apr 11, 2017

    @rynowak
    Contributor

    If we have a bug we should fix it.

    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.

  7. Eilon commented on Apr 11, 2017

    @Eilon
    Contributor

    @ryanbrandenburg that does appear to be a specific bug in that specific case.

  8. changed the title [-]EventID's should be unique per-package[/-] [+]EventID's should be unique per-category[/+] on Apr 11, 2017
  9. ryanbrandenburg commented on Apr 11, 2017

    @ryanbrandenburg
    ContributorAuthor

    Updated to reflect category vs package.

  10. added this to the 2.0.0-preview2 milestone on Apr 12, 2017
  11. Eilon commented on Apr 12, 2017

    @Eilon
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions