Skip to content

NLog/NLog.Web

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
November 13, 2022 21:03
December 6, 2023 21:43
December 6, 2023 21:43
January 5, 2016 18:38
December 6, 2023 21:43
May 30, 2020 03:30
August 31, 2015 21:45
December 6, 2023 23:12
October 15, 2023 21:02
December 6, 2023 21:43
September 30, 2017 01:29

NLog

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

NuGet Release

NuGet Release

Build status

These packages are extensions to NLog, and provides targets and layout-renderes specific to ASP.NET (Core), MVC and IIS.

Getting started with NLog

Config

Troubleshooting

Releases

For updates and releases, check CHANGELOG.MD or Releases

ASP.NET Core

The NLog.Web.AspNetCore-package supports the platforms:

  • For ASP.NET Core - .NET 5, 6, 7 and 8
  • For ASP.NET Core - .NET Core 3.1
  • For ASP.NET Core 2.1 .NET Standard 2.0 for .NET 4.6.1

ℹ️ Missing the trace and debug logs? Check your appsettings.json

Use the NLog.Web.AspNetCore package

ASP.NET (non-core)

The NLog.Web-package works with classic ASP.NET MVC

  <!-- enable ASP.NET layout renderers -->
  <extensions>
    <add assembly="NLog.Web"/>
  </extensions>

HTTP module (ASP.NET non-core)

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:

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

Contributions

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.

License

BSD