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.
Use names in EventIds for logging #6818
Closed
Description
When logging, we use int
s for the eventId
parameter, but the EventId
type that is used can actually also support holding a name. Names are easier to query and inspect in structure log storage. So, as an example, a LoggerMessage.Define
should change to something like this:
LoggerMessage.Define<...>(LogLevel.Trace, new EventId(1, "[Event Name]"), "... message ...");
(Event ID names don't need a prefix because EventId
is only unique within a Logger, so there's no need to prefix it).