This repo contains the .NET Core runtime, called CoreCLR. It is an execution engine for .NET apps, performing functions such as IL byte code loading, compilation to machine code and garbage collection. The repo contains the complete up-to-date CoreCLR codebase.
Anipik on 3.1
update branding to 3.1.14 (#281… (compare)
Anipik on 2.1
update branding to 2.1.27 (#281… (compare)
new TestClass
but keep IMyService
as a field in that class that is required by the constructor.
Action<ILogger, Dictionary<string, string>, Exception> _contextAction = LoggerMessage.Define<Dictionary<string, string>>(
LogLevel.Information,
new EventId(),
"context = {Context}");
var logger = loggerFactory.CreateLogger("Default");
logger.LogInformation("context = {Context}", context);
_contextAction(logger, context, null!);
I was expecting this to be equivalent but seems the state is not serialized in the same way.
{
"EventId": 0,
"LogLevel": "Information",
"Category": "Default",
"Message": "context = [User, Jose]",
"State": {
"Message": "context = [User, Jose]",
"Context": "[User, Jose]",
"{OriginalFormat}": "context = {Context}"
},
"Scopes": []
}
{
"EventId": 0,
"LogLevel": "Information",
"Category": "Default",
"Message": "context = [User, Jose]",
"State": {
"Message": "context = [User, Jose]",
"Context": "System.Collections.Generic.Dictionary\u00602[System.String,System.String]",
"{OriginalFormat}": "context = {Context}"
},
"Scopes": []
}
Any idea why the first version State
contains the serialized dictionary, and the second just the dictionary class name?