title: How to implement console logging in ASP.NET Core MVC Project?
body: <p>I’m learning ASP.NET Core and playing with fundamental stuff, but I wasn't able to enable logging in the application. How do i make it work?</p>
  
  <p>I've been looking to the documentation and comparing my code to the one provided as a sample in the microsoft documentation, but i can't figure out what am i doing wrong.</p>
  
  <p>Program.cs (I'm using the default builder which contains console logging provider)</p>
  
  <pre><code>public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;
              WebHost.CreateDefaultBuilder(args)
                  .UseStartup&lt;Startup&gt;();
  </code></pre>
  
  <p>HomeController.cs</p>
  
  <pre><code>    public class HomeController: Controller
      {
          private readonly ILogger _logger;
  
          public HomeController(
              ILogger&lt;HomeController&gt; logger)
          {
              _logger = logger;
          }
  
          public IActionResult Index()
          {
              _logger.LogCritical(_localizer["Hello"]);
              _logger.LogWarning("ASD");
              _logger.LogInformation("Getting item {ID}", 3);
  
              return View();
          }
      }   
  
  </code></pre>
  
  <p>appsettings.json</p>
  
  <pre><code>"Logging": {
      "Debug": {
        "LogLevel": {
          "Default": "Warning"
        }
      },
      "Console": {
        "IncludeScopes": false,
        "LogLevel": {
          "Microsoft.AspNetCore.Mvc.Razor.Internal": "Warning",
          "Microsoft.AspNetCore.Mvc.Razor.Razor": "Debug",
          "Microsoft.AspNetCore.Mvc.Razor": "Error",
          "Default": "Information"
        }
      },
      "LogLevel": {
        "Default": "Debug"
      }
    }
  </code></pre>
  
  <p>I'm able to see the messages but only in Debug output window, while in the sample project from the microsoft documentation there is a seperate "ASP.NET Core Web Server" output window where all log messages are printed and it's more readable.</p>
  
  <p><a href="https://i.stack.imgur.com/VHd7i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VHd7i.png" alt="enter image description here"></a></p>