Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Missing trace\debug logs in ASP.NET Core 3?

Rolf Kristensen edited this page Mar 3, 2022 · 5 revisions

Missing the trace and debug logs in ASP.NET Core 3?

Check your appsettings.json

The following is advised:

{
  "Logging": {
    "LogLevel": {
      "Default": "Trace",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "AllowedHosts": "*"
}

⚠️ Make sure also to check any environment specific appsettings.json. Ex. appsettings.development.json

Notice NLog.Web.AspNetCore ver. 4.12 introduces the new options ReplaceLoggerFactory and RemoveLoggerFactoryFilter for NLogAspNetCoreOptions. This allows NLog to be excluded from any filtering configured for Microsoft LoggerFactory. Example:

.UseNLog(new NLogAspNetCoreOptions() { RemoveLoggerFactoryFilter = true });

Clone this wiki locally

Morty Proxy This is a proxified and sanitized view of the page, visit original site.