You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, I'm working on a proprietary framework where Event IDs are structured as follows:
From 100 to (exclusively) 200: IDs represent events related to 'A' logical context.
From 200 to (exclusively) 300: IDs represent events related to 'B'.
I wonder if other framework or library developers use a similar approach. If so, the current EventId caching mechanism may not work well, as a new LogEventProperty might be allocated per call. In the case of source-generated logging, which implicitly generates an EventId, this could become a problem.
I propose storing EventId.Id in a Dictionary<int, LogEventProperty> and limiting the maximum number of items in this dictionary. I may submit a PR once this idea is accepted.
Any thoughts or concerns?
The text was updated successfully, but these errors were encountered:
Currently, the
EventId
LogEventProperty
cache is already implemented. Unfortunately, the caching approach assumes that large event IDs are rare.However, in the Microsoft logging documentation, large IDs are demonstrated.
Currently, I'm working on a proprietary framework where Event IDs are structured as follows:
From 100 to (exclusively) 200: IDs represent events related to 'A' logical context.
From 200 to (exclusively) 300: IDs represent events related to 'B'.
I wonder if other framework or library developers use a similar approach. If so, the current
EventId
caching mechanism may not work well, as a newLogEventProperty
might be allocated per call. In the case of source-generated logging, which implicitly generates anEventId
, this could become a problem.I propose storing
EventId.Id
in aDictionary<int, LogEventProperty>
and limiting the maximum number of items in this dictionary. I may submit a PR once this idea is accepted.Any thoughts or concerns?
The text was updated successfully, but these errors were encountered: