title: Logging not appearing in log file when using nlog
body: <p>I am using NLog with .net Core 3.1. I am trying to print out a debug statement in my controller where ILogger is injected like this:</p>
  
  <pre><code>public MyController(ILogger&lt;MyController&gt; logger) {
                  this.logger = logger;
      }
  
  [HttpGet)]
          public ActionResult&lt;List&lt;MyObject&gt;&gt; GetObjects()
          {
              logger.LogDebug("helloworld");
  }
  </code></pre>
  
  <p>When I debug the statement runs fine but nothing appears in the log file. Here are other relevant files. Is there something missing or incorrect in the configuration?</p>
  
  <p>Inside program.cs</p>
  
  <pre><code>public static IHostBuilder CreateHostBuilder(string[] args) =&gt;
              Host.CreateDefaultBuilder(args)
                  .ConfigureWebHostDefaults(webBuilder =&gt;
                  {
                      webBuilder.UseStartup&lt;Startup&gt;();
                  })
                  .ConfigureLogging(logging =&gt;
                  {
                      logging.ClearProviders();
                      logging.SetMinimumLevel(LogLevel.Debug);
                  })
                  .UseNLog();  // NLog: Setup NLog for Dependency injection
  </code></pre>
  
  <p>Inside nlog.config</p>
  
  <pre><code>&lt;targets&gt;
      &lt;!-- write logs to file  --&gt;
      &lt;target xsi:type="File" name="allfile" fileName="c:\logs\nlog-all-${shortdate}.log"
              layout="${callsite} -${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" /&gt;
  
      &lt;!-- another file log, only own logs. Uses some ASP.NET core renderers --&gt;
      &lt;target xsi:type="File" name="ownFile-web" fileName="c:\logs\nlog-own-${shortdate}.log"
              layout="${callsite} -${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}" /&gt;
    &lt;/targets&gt;
  
     &lt;!--rules to map from logger name to target--&gt; 
    &lt;rules&gt;
      &lt;logger name="*" minlevel="Debug" writeTo="allfile" /&gt;        
    &lt;/rules&gt;
  </code></pre>
  
  <p>in appsettings.json</p>
  
  <pre><code>"Logging": {
      "IncludeScopes": false,
      "LogLevel": {
        "Default": "Trace",
        "Microsoft": "Warning",
        "Microsoft.Hosting.Lifetime": "Information"
      }
    },
  </code></pre>