We know that we can get values from json with the IConfiguration class with the GetSection method or simply with configuration["Serilog:Properties:ApplicationName"]; in case of array with configuration.GetSection("Serilog.Enrich").Get<string[]>()
But I don't know how to retrieve the value of "serverUrl" key that is nested in the first node of the WriteTo array
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning",
"Serilog": "Warning"
}
},
"Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId" ],
"Properties": {
"ApplicationName": "MyApp"
},
"WriteTo": [
{
"Name": "Seq",
"Args": {
"serverUrl": "http://localhost:5341"
}
}
]
}
Any suggestion?