Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging LogLevel should be handled as namespace prefix #519

Closed
wdolek opened this issue Sep 2, 2019 · 1 comment
Closed

Logging LogLevel should be handled as namespace prefix #519

wdolek opened this issue Sep 2, 2019 · 1 comment

Comments

@wdolek
Copy link
Contributor

wdolek commented Sep 2, 2019

It is common to use typed ILogger<T> in .NET - this will produce category which equals to full type name, so for example ILogger<HttpClient> has category System.Net.Http.HttpClient.

Usually, this should be enough to have Debug level for HttpClient:

    "LogLevel": {
      "Microsoft": "Information",
      "System": "Warning",
      "System.Net": "Information",
      "System.Net.Http": "Debug"
    }

Yet in order to make this work, wildcards must be used like this:

    "LogLevel": {
      "Microsoft.*": "Information",
      "System.*": "Warning",
      "System.Net.*": "Information",
      "System.Net.Http.*": "Debug"
    }

I spent quite a lot of time debugging my configuration not realizing this. In addition to wildcards, I propose adding simple support of namespace prefixes as well, which is common in .NET.

Framework documentation: Logging in .NET Core and ASP.NET Core.

@normj
Copy link
Member

normj commented Oct 26, 2019

PR merged and released

@normj normj closed this as completed Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants