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, with MEL, only log scopes are included in the context data (using logger.BeginScope(...)). The log attributes that are passed as arguments to the standard logger.Log* methods are not in the context data. They are included in the formatted message, but then they lose a lot of value because they need to be parsed back out during ingestion.
For example, explicit calls to the logger (or logger extension methods) like this do not have MyData as a context data value:
logger.LogInformation("My log message with some data: {MyData}", myData);
or via the Source Generator (generated) calls like this do not have the RouteData, MethodInfo, etc as context data values:
[LoggerMessage(102, LogLevel.Information,"Route matched with {RouteData}. Executing controller action with signature {MethodInfo} on controller {Controller} ({AssemblyName}).", EventName ="ControllerActionExecuting", SkipEnabledCheck =true)]privatestaticpartialvoidControllerActionExecuting(ILoggerlogger,stringrouteData,MethodInfomethodInfo,stringcontroller,string?assemblyName);
Describe Alternatives
None considered
Additional context
I believe this already works as described with other loggers (e.g. Serilog and NLog), but I could be wrong.
Priority
Really Want
The text was updated successfully, but these errors were encountered:
@tylerohlsen thank you for submitting this feature request. I passed the information along to other members of the team so that it can be further reviewed.
Feature Description
Currently, with MEL, only log scopes are included in the context data (using
logger.BeginScope(...)
). The log attributes that are passed as arguments to the standardlogger.Log*
methods are not in the context data. They are included in the formatted message, but then they lose a lot of value because they need to be parsed back out during ingestion.For example, explicit calls to the logger (or logger extension methods) like this do not have MyData as a context data value:
or via the Source Generator (generated) calls like this do not have the RouteData, MethodInfo, etc as context data values:
Describe Alternatives
None considered
Additional context
I believe this already works as described with other loggers (e.g. Serilog and NLog), but I could be wrong.
Priority
Really Want
The text was updated successfully, but these errors were encountered: