NLog integration for ASP.NET & ASP.NET Core 1+2

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

AppVeyor BCH compliance

These packages are extensions to NLog.

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

  • Version (ASP.NET Core 1+2)
  • Version (ASP.NET)

Getting started


For updates and releases, check CHANGELOG.MD or Releases

ASP.NET Core 1 / ASP.NET Core 2

ℹ️ 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.


Include in your nlog.config:

<!-- enable core layout renderers -->
  <add assembly="NLog.Web.AspNetCore"/>

ASP.NET (non-core)

Use the NLog.Web package.


Simply install the package. NLog will detect the extension automatically.

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" />