title: How do I configure Microsoft.Extensions.Logging.ILogger levels per namespace?
body: <p>I want to be able to configure the nested levels like Microsoft.AspNetCore.Mvc/DataProtection independently of just Microsoft.*, is this possible, if so how do I do it?
  The logging works and I see currently see everything at debug but nothing is excluded.</p>
  
  <p>I'm injecting the settings etc into a class which is configured in Program.cs like this</p>
  
  <pre><code>var builder = new ConfigurationBuilder().SetBasePath(Environment.CurrentDirectory);
  
  builder.AddJsonFile("appsettings.json", true, true);
  
  var envName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
  if (string.IsNullOrWhiteSpace(envName))
      builder.AddJsonFile($"appsettings.${envName}.json", true);
  
  builder.AddEnvironmentVariables();
  builder.AddCommandLine(args);
  
  var configurationRoot = builder.Build();
  
  new WebHostBuilder()
      .UseKestrel(options =&gt;
          { options.Limits.MaxRequestBodySize = null; })
      .UseContentRoot(Directory.GetCurrentDirectory())
      .UseConfiguration(configurationRoot)
      .ConfigureLogging(lb =&gt;
       {
           lb.AddConsole();
           lb.AddDebug();
           lb.SetMinimumLevel(LogLevel.Trace);
       })
      .UseStartup&lt;Startup&gt;()
      .UseIISIntegration()
      .Build()
      .Run();
  </code></pre>
  
  <p>with Startup.cs injecting the logger and config like</p>
  
  <pre><code>public Startup(ILogger&lt;Startup&gt; iLogger, IConfiguration iConfiguration)
  {
      _configuration = iConfiguration;
      _logger = iLogger;
      _logger.LogDebug("Configured logger, config and builder.");
  }
  </code></pre>
  
  <p>with logging config in appsettings.json like</p>
  
  <pre><code>"Logging": {
    "IncludeScopes": true,
    "LogLevel": {
      "Microsoft.AspNetCore.Mvc": "Warning",
      "Microsoft.AspNetCore.DataProtection": "Warning",
      "Default": "Debug"
    }
  }
  </code></pre>
  
  <p>Coming from log4j I'd attempt something like the above but it's not working, where have I gone wrong?</p>