C#C
C#3y ago
8 replies
thiccode

✅ how do logging settings work

i'm trying to change logging settings for another issue, but they doesn't seem to be intuitive or really not even to work like the docs say
shouldn't this filter almost everything?
{
  "Logging": {
      "Serilog": {
          "IncludeScopes": true
      },
      "LogLevel": {
          "Default": "Warning"
      }
  },
  "Serilog": {
      "WriteTo": [
          {
              "Name": "Console",
              "Args": {
                  "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} {Level:u3}] {Message:lj}{NewLine}{Exception}"
              }
          }
      ]
  },
}

instead i see even debug logs

there are no other settings (like other appsettings or environment variables)
it would be really nice if for once i didn't have to look at the source code to understand how it works
Was this page helpful?