Skip to content

Clarify the true semantics of EventId #11312

Open
@aradalvand

Description

@aradalvand

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions