apm-agent-dotnet icon indicating copy to clipboard operation
apm-agent-dotnet copied to clipboard

How to handle differently set log levels in ASP. NET Core and Elastic.Apm?

Open z1c0 opened this issue 2 years ago • 0 comments

Right now, there is some ambiguity when specifying log levels for an ASP.NET Core application. The LogLevel can be specified via the built-in Logging node but also via Elastic.Apm.

{
  "Logging": {
    "LogLevel": {
      "Default": "Warning",
      "Elastic.Apm": "Error"
    }
  },
  "AllowedHosts": "*",
  "ElasticApm": {
    "ServerUrls": "http://localhost:8200",
    "LogLevel" : "Trace"  
  }
}

The goal of this issue is to specify:

  • What's happening when both or either of these settings are present.
    • What should happen? What's a reasonable user expectation in that case?
  • How the NetCoreLogger should deal with changes to the log level via central config
  • How this works together with other logging frameworks (e.g. Serilog).

z1c0 avatar Oct 27 '22 14:10 z1c0