NLog.Web.AspNetCore 6.1.2
NLog.Web.AspNetCore
Integrates NLog as Logging provider for the ASP.NET Core platform, by just calling UseNLog() with the application host-builder.
Providing features like:
- Enrich logging output with additional details from active HttpContext using NLog LayoutRenderers, by just updating the NLog configuration.
- Supports middleware injection for HTTP Request Logging and HTTP Response Logging.
- Load NLog configuration from appsettings.json
- Capture structured message properties from the Microsoft ILogger
- Capture scope context properties from the Microsoft ILogger
BeginScope - Routing logging output to multiple destinations via the available NLog Targets
- Rendering logging output into standard formats like JSON, CVS, W3C ELF and XML using NLog Layouts.
- Contributions are always welcome, by creating a pull request.
Supported platforms:
- ASP.NET Core 6, 7, 8, 9 and 10
- ASP.NET Core 2, .NET Standard 2.0 and .NET 4.6.2+
Register NLog as logging provider:
builder.Logging.ClearProviders();
builder.Host.UseNLog();
If logging is needed before the host building, then one can use fluent setup:
var logger = NLog.LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
Alternative include NLog.Web.AspNetCore extension in the NLog.config file:
<extensions>
<add assembly="NLog.Web.AspNetCore"/>
</extensions>
Useful Links:
No packages depend on NLog.Web.AspNetCore.
ChangeLog:
- [#1118] Updated dependency NLog v6.1.1 (@snakefoot)
List of major changes in NLog v6.0: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html
Full changelog: https://github.com/NLog/NLog.Web/releases
List of available Layout Renderers: https://nlog-project.org/config/?tab=layout-renderers&search=package:nlog.web.aspnetcore
.NET Framework 4.6.2
- Microsoft.AspNetCore.Hosting.Abstractions (>= 2.3.0)
- Microsoft.AspNetCore.Http (>= 2.3.0)
- Microsoft.AspNetCore.Routing.Abstractions (>= 2.3.0)
- NLog.Extensions.Logging (>= 6.1.2)
.NET 6.0
- NLog.Extensions.Logging (>= 6.1.2)
.NET 8.0
- NLog.Extensions.Logging (>= 6.1.2)
.NET 10.0
- NLog.Extensions.Logging (>= 6.1.2)
.NET Standard 2.0
- Microsoft.AspNetCore.Hosting.Abstractions (>= 2.3.0)
- Microsoft.AspNetCore.Http (>= 2.3.0)
- Microsoft.AspNetCore.Routing.Abstractions (>= 2.3.0)
- NLog.Extensions.Logging (>= 6.1.2)
| Version | Downloads | Last updated |
|---|---|---|
| 6.1.2 | 2 | 03/20/2026 |
| 6.1.1 | 0 | 01/31/2026 |
| 6.1.0 | 0 | 11/12/2025 |
| 6.0.6 | 0 | 11/09/2025 |
| 6.0.5 | 0 | 10/09/2025 |
| 6.0.4 | 0 | 09/11/2025 |
| 6.0.3 | 0 | 08/10/2025 |
| 6.0.2 | 0 | 07/20/2025 |
| 6.0.1 | 0 | 06/28/2025 |
| 6.0.0 | 0 | 06/21/2025 |
| 5.5.0 | 0 | 05/29/2025 |
| 5.4.0 | 0 | 02/02/2025 |
| 5.3.15 | 0 | 11/21/2024 |
| 5.3.14 | 0 | 09/23/2024 |
| 5.3.13 | 0 | 09/12/2024 |
| 5.3.12 | 0 | 08/12/2024 |
| 5.3.11 | 1 | 03/20/2026 |
| 5.3.10 | 0 | 04/30/2024 |
| 5.3.9 | 0 | 04/27/2024 |
| 5.3.8 | 0 | 12/29/2023 |
| 5.3.7 | 0 | 12/06/2023 |
| 5.3.5 | 0 | 10/15/2023 |
| 5.3.4 | 0 | 09/06/2023 |
| 5.3.3 | 0 | 08/06/2023 |
| 5.3.2 | 0 | 07/04/2023 |
| 5.3.1 | 0 | 07/01/2023 |
| 5.3.0 | 0 | 05/30/2023 |
| 5.2.3 | 0 | 03/28/2023 |
| 5.2.2 | 0 | 02/17/2023 |
| 5.2.1 | 0 | 12/30/2022 |
| 5.2.0 | 0 | 11/27/2022 |
| 5.1.5 | 0 | 10/25/2022 |
| 5.1.4 | 0 | 09/01/2022 |
| 5.1.2 | 0 | 09/01/2022 |
| 5.1.1 | 0 | 08/17/2022 |
| 5.1.0 | 0 | 07/18/2022 |
| 5.0.0 | 0 | 05/17/2022 |
| 4.15.0 | 0 | 06/04/2022 |
| 4.14.0 | 0 | 08/28/2021 |
| 4.13.0 | 0 | 07/14/2021 |
| 4.13.0-readme-preview | 0 | 05/03/2021 |
| 4.12.0 | 0 | 03/29/2021 |
| 4.11.0 | 0 | 02/27/2021 |
| 4.10.0 | 0 | 12/30/2020 |
| 4.9.3 | 0 | 08/01/2020 |
| 4.9.2 | 0 | 04/20/2020 |
| 4.9.1 | 0 | 03/30/2020 |
| 4.9.0 | 0 | 10/11/2019 |
| 4.8.6 | 0 | 09/30/2019 |
| 4.8.5 | 0 | 09/07/2019 |
| 4.8.4 | 0 | 07/02/2019 |
| 4.8.3 | 0 | 06/05/2019 |
| 4.8.2 | 0 | 05/06/2019 |
| 4.8.1 | 0 | 03/18/2019 |
| 4.8.0 | 0 | 01/25/2019 |
| 4.7.1 | 0 | 01/06/2019 |
| 4.7.0 | 0 | 09/22/2018 |
| 4.6.0 | 0 | 08/05/2018 |
| 4.5.4 | 0 | 05/10/2018 |
| 4.5.3 | 0 | 04/29/2018 |
| 4.5.2 | 0 | 04/12/2018 |
| 4.5.1 | 0 | 04/02/2018 |
| 4.5.0 | 0 | 03/27/2018 |
| 4.4.1 | 0 | 06/16/2017 |
| 4.4.0 | 0 | 05/14/2017 |
| 4.3.1 | 0 | 02/10/2017 |
| 4.3.0 | 0 | 01/18/2017 |
| 4.2.4 | 0 | 07/03/2016 |
| 4.2.3 | 0 | 05/24/2016 |