Great that MS standardized logging with the ILogger interface (MEL), making it easy for us to set up common logging. But a side effect of frameworks (EF, ASP.NET MVC etc.) doing proper logging and sharing the LoggerFactory in the ServiceProvider, is that Errors are logged twice. Once in the framework and second in my code handling the Exception. I find myself always disabling Logging in all other namespaces but my own to prevent this.
"Logging": {
"LogLevel": {
"Default": "None",
"MyNamespace": "Warning",
}
}
How do I prevent my frameworks for logging the same ERROR as I would log in my Exception handling in my namespace? In my namespace I would have a _logger.LogError(ex, "Some Message")
Edit: Another unwanted side-effect when my 3rd party frameworks is logging errors, is when using retries on transient errors. It is only a error if all retries fails. How would the IT Operations deals with false errors, if I do not disable logging errors from my 3rd party frameworks?