Awesome Open Source
Awesome Open Source


NLog.Web (ASP.NET & ASP.NET Core)

AppVeyor Version Version

These packages are extensions to NLog.

The packages contain targets and layout-renderes specific to ASP.NET (Core), MVC and IIS.

Getting started with NLog




For updates and releases, check CHANGELOG.MD or Releases


ASP.NET Core 1, 2, 3 and 5 are supported!

Supported platforms:

  • For ASP.NET Core 5, .NET 5
  • For ASP.NET Core 3, .NET Core 3.0
  • For ASP.NET Core 2, .NET Standard 2.0+ and .NET 4.6+
  • For ASP.NET Core 1, .NET Standard 1.5+ and .NET 4.5.x

ℹ️ Missing the trace and debug logs in .NET Core 2? Check your appsettings.json

Use the NLog.Web.AspNetCore package

There is a special package for ASP.NET Core / MVC Core. This is needed because we can't detect if ASP.NET or ASP.NET Core is used. The package depends on NLog.Extensions.Logging - which integrates with the ASP.NET Core logging system.

ASP.NET (non-core)

Use the NLog.Web package.

HTTP module (ASP.NET non-core)

note: not listed on

There is a ASP.NET ASP.NET HttpModule that enables NLog to hook BeginRequest and EndRequest events easily.

The NLogHttpModule needs a registration in the web.config:

	<modules runAllManagedModulesForAllRequests="true"> 
		<add name="NLog" type="NLog.Web.NLogHttpModule, NLog.Web" />


Contributions are highly appreciated! Please make sure if works for ASP.NET and ASP.NET Core if possible and make sure it is covered by unit tests.



Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
c-sharp (11,732
asp-net-core (183
asp-net (53
asp-net-core-mvc (26
nlog (21

Find Open Source By Browsing 7,000 Topics Across 59 Categories