I'm using ASP.NET Core 2.1.
Why am I getting Expression must be of type object for IncludeScopes in my appsettings.json file?

Here's a simplified version of the JSON needed to show the warning. To reproduce this, you just need to create a blank ASP.NET Core project and update appsettings.json:
{
"Logging": {
"IncludeScopes": false,
"Debug": {
"LogLevel": {
"Default": "Warning"
}
},
"Console": {
"LogLevel": {
"Default": "Warning"
}
}
},
"serilog": {
"write-to": {
"sumologic.url": "http://localhost",
"RollingFile.pathFormat": "R\\Document\\API\\Logs-{Date}.log"
}
}
}
As the github issue said, you add the IncludeScopes to the wrong level. Change like below:
{
"Logging": {
"Console": {
"LogLevel": {
"Default": "Warning"
},
"IncludeScopes": false
},
"Debug": {
"LogLevel": {
"Default": "Warning"
}
}
},
"serilog": {
"write-to": {
"sumologic.url": "http://localhost",
"RollingFile.pathFormat": "R\\Document\\API\\Logs-{Date}.log"
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With