mattwcole / gelf-extensions-logging

GELF provider for Microsoft.Extensions.Logging
MIT License
109 stars 42 forks source link

LogLevel not inherited from top level #47

Closed mersadk closed 4 years ago

mersadk commented 4 years ago

If I configure GELF like this, I will receive messages from Microsoft packages to GrayLog. GELF node doesn't contain LogLevel node.

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
    },
    "GELF": {
      ...
    }
  }
}

From what I understand GELF should inherit settings top level regarding LogLevel, but it doesn't. Is this intended behavior or bug?

mattwcole commented 4 years ago

Thanks for reporting, yes the log level should be inherited. I'll see if I can reproduce the issue.

mattwcole commented 4 years ago

I just tried this with one of the sample apps and it appears to be working. "Logging:LogLevel" is used when "Logging:GELF:LogLevel" is not set in the config. Maybe you are overriding your appsettings.json with appsettings.Development.json?

mattwcole commented 4 years ago

I'm going to close this for now, but feel free to re-open if you feel this is still an issue.