Skip to content
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

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

Closed
maxkoshevoi opened this issue Jul 15, 2022 · 4 comments · Fixed by #85581
Closed

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

maxkoshevoi opened this issue Jul 15, 2022 · 4 comments · Fixed by #85581

Comments

@maxkoshevoi
Copy link
Contributor

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

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jul 15, 2022
@ghost
Copy link

ghost commented Jul 15, 2022

Tagging subscribers to this area: @dotnet/area-extensions-logging
See info in area-owners.md if you want to be subscribed.

Issue Details

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

Author: maxkoshevoi
Assignees: -
Labels:

untriaged, area-Extensions-Logging

Milestone: -

@maxkoshevoi maxkoshevoi 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 Jul 15, 2022
@eerhardt eerhardt added this to the Future milestone Jul 15, 2022
@eerhardt eerhardt removed the untriaged New issue has not been triaged by the area owner label Jul 15, 2022
@havocbcn
Copy link

havocbcn commented Aug 2, 2022

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.

@davidfowl
Copy link
Member

Event ids are per category

@ShreyasJejurkar
Copy link
Contributor

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

@ghost ghost added in-pr There is an active PR which will close this issue when it is merged and removed in-pr There is an active PR which will close this issue when it is merged labels May 1, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label May 1, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants