Skip to content

Clarify the true semantics of EventId #11312

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

Open
aradalvand opened this issue May 17, 2025 · 1 comment
Open

Clarify the true semantics of EventId #11312

aradalvand opened this issue May 17, 2025 · 1 comment

Comments

@aradalvand
Copy link

aradalvand commented May 17, 2025

Apparently, a log's EventId uniquely identifies it within its category (dotnet/runtime#72263) and also decouples its identity from its message template (dotnet/runtime#70147), which is prone to change — this makes enough sense:

Event ids are per category. - @davidfowl

(emphasis mine)

IDs are also unique per category. - @davidfowl

(emphasis mine)

In a log viewer if you want to search for occurences of a specific event it would be much easier to search for its ID. The message might change but the same event would have the same ID. - @teo-tsirpanis

However, documentation is this regard is absolutely terrible and full of contradiction; here, the docs explicitly state that event IDs identify "groups" of logs, not individual logs:

An event ID associates a set of events. For example, all logs related to reading values from a repository might be 1001.

(emphasis mine)

but the analyzer that emits a diagnostic when more than one individual log uses the same event ID which, along with David Fowler said on the matter, contradict the documentation. Worse yet, the diagnostic's documentation says that EventIds ought to be unique within each assembly (which is a semantic that's neither enforced by the analyzer itself — which only looks at the containing class — nor mentioned anywhere else.):

Event ID values must be unique within the scope of each assembly.

(emphasis mine)

Big mess. Please properly specify the intended semantics of EventId and follow it consistently.

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label May 17, 2025
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 17, 2025
@teo-tsirpanis teo-tsirpanis added area-Extensions-Logging and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels May 17, 2025
Copy link
Contributor

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

@aradalvand aradalvand changed the title Clarify the intended semantics of EventId Clarify the true semantics of EventId May 17, 2025
@tarekgh tarekgh transferred this issue from dotnet/runtime May 18, 2025
@tarekgh tarekgh added this to the Backlog milestone May 18, 2025
@tarekgh tarekgh removed the untriaged New issue has not been triaged by the area owner label May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants