NLog 5.0.0
Prefix ReservedSee the version list below for details.
dotnet add package NLog --version 5.0.0
NuGet\Install-Package NLog -Version 5.0.0
<PackageReference Include="NLog" Version="5.0.0" />
<PackageVersion Include="NLog" Version="5.0.0" />
<PackageReference Include="NLog" />
paket add NLog --version 5.0.0
#r "nuget: NLog, 5.0.0"
#:package NLog@5.0.0
#addin nuget:?package=NLog&version=5.0.0
#tool nuget:?package=NLog&version=5.0.0
See Release post
Details of changes: See here
Major Features
- NLog is now faster and lighter
- NLog Layout for everything
- NLog ScopeContext to replace MDC + MDLC + NDC + NDLC
- NLog Layout stored as NLog Configuration Variables
- Fluent API for NLog LoggingConfiguration
- NLog Callsite from caller member attributes
- LogFactory with Dependency Injection
- Aliases support for targets, layouts, layout renderers and conditions\
- Dashes (-) will be ignored when parsing names
Breaking Changes
See rationale here
- Strong Version Changed
- Obsolete methods have been removed
- Xamarin, Windows Phone and Silverlight platforms have been removed
- .NET Framework v4.0 platform removed and replaced with .NET Framework v4.6
- NLog Extensions assemblies will not load automatically
- NLog Targets extracted into their own nuget-packages
- Deprecated NLog.Extended nuget-package
- Deprecated NLog.Config nuget-package
- Automatic loading of NLog.config now first check for exe.nlog
- NLog Configuration will have KeepVariablesOnReload enabled by default
- Layout and LayoutRenderer are now threadsafe by default
- Default Layout for NLog Targets has been updated
- Default Format for NLog Exception layoutrenderer has been updated
- NLog InternalLogger will not initialize itself from app.config or environment variables
- Removed obsolete method Target.Write(AsyncLogEventInfo[]) and OptimizeBufferReuse is always true
- ScopeContext changes MappedDiagnosticContext (MDC) to use AsyncLocal
- MappedDiagnosticContext (MDC), MappedDiagnosticLogicalContext (MDLC), GlobalDiagnosticContext (GDC) now case-insensitive
- FileTarget KeepFileOpen = true by default
- FileTarget ConcurrentWrites = false by default
- FileTarget Encoding default value changed to UTF8
- FileTarget will include BOM by default for UTF16 and UTF32 encoding
- NetworkTarget will Discard by default on overflow
- JsonLayout MaxRecursionLimit default value changed to 1
- JsonLayout EscapeForwardSlash default value changed to false
- JsonLayout always includes decimal point for floating-point types
- CallSite-renderer will automatically clean async callstacks
- LoggingRule Filters DefaultAction changed to FilterResult.Ignore
- NLog.Extensions.Logging without any filter
- NLog.Extensions.Logging changes capture of EventId
- The Simplelayout.ToString() has been changed
Many other improvements
For a full list of all the enhancements and performance improvements: NLog 5.0 Pull Requests
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard1.3 is compatible. netstandard1.4 was computed. netstandard1.5 is compatible. netstandard1.6 was computed. netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net35 is compatible. net40 was computed. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
| Universal Windows Platform | uap was computed. uap10.0 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 3.5
- No dependencies.
-
.NETFramework 4.5
- No dependencies.
-
.NETFramework 4.6
- No dependencies.
-
.NETStandard 1.3
- Microsoft.Extensions.PlatformAbstractions (>= 1.0.0)
- NETStandard.Library (>= 1.6.0)
- System.ComponentModel.Primitives (>= 4.3.0)
- System.ComponentModel.TypeConverter (>= 4.3.0)
- System.Data.Common (>= 4.3.0)
- System.Diagnostics.StackTrace (>= 4.3.0)
- System.Net.Http (>= 4.3.4)
- System.Net.NameResolution (>= 4.3.0)
- System.Net.Requests (>= 4.3.0)
- System.Reflection.TypeExtensions (>= 4.3.0)
- System.Text.RegularExpressions (>= 4.3.1)
- System.Xml.XmlDocument (>= 4.3.0)
-
.NETStandard 1.5
- NETStandard.Library (>= 1.6.0)
- System.ComponentModel.Primitives (>= 4.3.0)
- System.ComponentModel.TypeConverter (>= 4.3.0)
- System.Data.Common (>= 4.3.0)
- System.Diagnostics.Process (>= 4.3.0)
- System.Diagnostics.StackTrace (>= 4.3.0)
- System.Diagnostics.TraceSource (>= 4.3.0)
- System.IO.FileSystem.Watcher (>= 4.3.0)
- System.Net.Http (>= 4.3.4)
- System.Net.NameResolution (>= 4.3.0)
- System.Net.Requests (>= 4.3.0)
- System.Reflection.TypeExtensions (>= 4.3.0)
- System.Runtime.Loader (>= 4.3.0)
- System.Text.RegularExpressions (>= 4.3.1)
- System.Threading.Thread (>= 4.3.0)
- System.Xml.XmlDocument (>= 4.3.0)
-
.NETStandard 2.0
- No dependencies.
NuGet packages (3.0K)
Showing the top 5 NuGet packages that depend on NLog:
| Package | Downloads |
|---|---|
|
NLog.Extensions.Logging
NLog LoggerProvider for Microsoft.Extensions.Logging for logging in .NET Standard libraries and .NET Core applications. For ASP.NET Core, check: https://www.nuget.org/packages/NLog.Web.AspNetCore |
|
|
NLog.Config
NLog.config file to get started with configuring NLog. This package is not mandatory to get started with NLog: the configuration file can created manually (read specs here: https://github.com/NLog/NLog/wiki/Configuration-file) or the configuration can be created programmatically. (read more here: https://github.com/NLog/NLog/wiki/Configuration-API) Note: Unfortunately this package won't work well when using <PackageReference> Advised to: - download manually: https://raw.githubusercontent.com/NLog/NLog/v4.4/src/NuGet/NLog.Config/content/NLog.config - set "Copy To Output Directory" to "Copy if newer" |
|
|
Microsoft.ApplicationInsights.NLogTarget
Application Insights NLog Target is a custom target allowing you to send NLog log messages to Application Insights. Application Insights will collect your logs from multiple sources and provide rich powerful search capabilities. Privacy statement: https://go.microsoft.com/fwlink/?LinkId=512156 |
|
|
NLog.Database
NLog.Database includes DatabaseTarget for writing to any database with DbProvider support |
|
|
AWS.Logger.NLog
An AWS NLog target that records logging messages to Amazon CloudWatch Logs. |
GitHub repositories (442)
Showing the top 20 popular GitHub repositories that depend on NLog:
| Repository | Stars |
|---|---|
|
2dust/v2rayN
A GUI client for Windows, Linux and macOS, support Xray and sing-box and others
|
|
|
shadowsocks/shadowsocks-windows
A C# port of shadowsocks
|
|
|
BeyondDimension/SteamTools
🛠「Watt Toolkit」是一个开源跨平台的多功能 Steam 工具箱。
|
|
|
lively-community/lively
Free and open-source software that allows users to set animated desktop wallpapers and screensavers powered by WinUI 3.
|
|
|
Sonarr/Sonarr
Smart PVR for newsgroup and bittorrent users.
|
|
|
Jackett/Jackett
API Support for your favorite torrent trackers
|
|
|
Flow-Launcher/Flow.Launcher
:mag: Quick file search & app launcher for Windows with community-made plugins
|
|
|
srwi/EverythingToolbar
Everything integration for the Windows taskbar.
|
|
|
Radarr/Radarr
Movie organizer/manager for usenet and torrent users.
|
|
|
JosefNemec/Playnite
Video game library manager with support for wide range of 3rd party libraries and game emulation support, providing one unified interface for your games.
|
|
|
AutoDarkMode/Windows-Auto-Night-Mode
Automatically switches between the dark and light theme of Windows 10 and Windows 11
|
|
|
LykosAI/StabilityMatrix
Multi-Platform Package Manager for Stable Diffusion
|
|
|
Richasy/Bili.Uwp
适用于新系统UI的哔哩
|
|
|
Prowlarr/Prowlarr
Prowlarr is an indexer manager/proxy built on the popular *arr .net/reactjs base stack to integrate with your various PVR apps, supporting management of both Torrent Trackers and Usenet Indexers.
|
|
|
Facepunch/sbox-public
s&box is a modern game engine, built on Valve's Source 2 and the latest .NET technology, it provides a modern intuitive editor for creating games
|
|
|
canton7/SyncTrayzor
Windows tray utility / filesystem watcher / launcher for Syncthing
|
|
|
Lidarr/Lidarr
Looks and smells like Sonarr but made for music.
|
|
|
ServiceStack/ServiceStack
Thoughtfully architected, obscenely fast, thoroughly enjoyable web services for all
|
|
|
Azure/azure-powershell
Microsoft Azure PowerShell
|
|
|
unchihugo/FluentFlyout
The modern Flyout app for Windows 11, built with Fluent 2 Design principles. Media Flyouts, Taskbar Widgets and more.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 6.2.1 | 708,556 | 9/16/2026 |
| 6.2.0 | 1,355,951 | 8/16/2026 |
| 6.1.4 | 2,056,004 | 7/8/2026 |
| 6.1.3 | 4,611,495 | 5/4/2026 |
| 6.1.2 | 1,568,429 | 4/1/2026 |
| 6.1.1 | 3,609,047 | 2/28/2026 |
| 6.1.0 | 1,967,246 | 1/31/2026 |
| 6.0.7 | 3,013,021 | 12/9/2025 |
| 6.0.6 | 3,427,376 | 11/9/2025 |
| 6.0.5 | 2,054,768 | 10/9/2025 |
| 6.0.4 | 1,840,033 | 9/11/2025 |
| 6.0.3 | 4,398,171 | 8/10/2025 |
| 6.0.2 | 1,741,202 | 7/20/2025 |
| 6.0.1 | 1,244,615 | 6/27/2025 |
| 6.0.0 | 975,422 | 6/21/2025 |
| 5.5.1 | 7,125,203 | 7/18/2025 |
| 5.0.0 | 10,246,482 | 5/16/2022 |
List of major changes in NLog 5.0: https://nlog-project.org/2022/05/16/nlog-5-0-finally-ready.md
Full changelog: https://github.com/NLog/NLog/blob/master/CHANGELOG.md
For all config options and platform support, check https://nlog-project.org/config/