Skip to content

False positive for SYSLIB1006 when user haven't specified EventID #72263

Closed

Description

@maxkoshevoi

Description

Related to discussion in #70147 (reply in thread)
CC: @davidfowl

SYSLIB1006 warning states that multiple logging methods cannot use the same event ID.

But it also fires when EventID isn't specified at all. I've annotated my methods without event id:

[LoggerMessage(Level = LogLevel.Information, Message = "Hi there")]
...
[LoggerMessage(Level = LogLevel.Information, Message = "Hi there2")]

and still get a SYSLIB1006 warning.
image

Reproduction Steps

Shown above

Expected behavior

No warning or at least lower severity event

Actual behavior

Warning which fails the build (since we have Treat warnings as errors enabled)

Regression?

No

Known Workarounds

Disable the warning

Configuration

No response

Other information

No response

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Jul 15, 2022
  2. changed the title [-]Create a new `Info` level event instead of `SYSLIB1006` for cases where user haven't specified `EventID`[/-] [+]False positive for `SYSLIB1006` when user haven't specified `EventID`[/+] on Jul 15, 2022
  3. added this to the Future milestone on Jul 15, 2022
  4. removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 15, 2022
  5. havocbcn commented on Aug 2, 2022

    @havocbcn

    According to https://docs.microsoft.com/en-us/dotnet/core/extensions/logging?tabs=command-line#log-event-id
    the same EventId could be repeated in different logs.

  6. davidfowl commented on Aug 2, 2022

    @davidfowl
    Member

    Event ids are per category

  7. ShreyasJejurkar commented on May 1, 2023

    @ShreyasJejurkar
    Contributor

    When this would get addressed? I just now hit this issue!

  8. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on May 1, 2023
  9. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on May 1, 2023
  10. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on May 1, 2023
  11. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on May 1, 2023
  12. ghost locked as resolved and limited conversation to collaborators on May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions