NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet, #99 most downloaded on NuGet
NLog is a logging platform for .NET with rich log routing and management capabilities. NLog supports traditional logging, structured logging and the combination of both. Supported platforms: - .NET 6, 7, 8, 9 and 10 - .NET Standard 2.0 and 2.1 - .NET Framework 3.5 - 4.8 - Xamarin Android + iOS (.NET Standard) - Mono 4 For integrating NLog with Microsoft.Extensions.Logging, check: https://www.nuget.org/packages/NLog.Extensions.Logging For using NLog with ASP.NET Core, check: https://www.nuget.org/packages/NLog.Web.AspNetCore
Latest stable
6.2.2
Last release 1 months ago
15 Oct 2026
Ships on a steady schedule
a new release about every 4 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
98 versions withdrawn
withdrawn after publishing
127 years old
222 releases · first in 1900
Drag across the ruler to compare, or tap a release to open it.
[#6292] CachedLayoutRendererWrapper - Support CachedUntil=HourChange and CachedUntil=DayChange. (@dualfroz)
Changelog:
NLog v6.2 release notes: https://nlog-project.org/2026/08/16/nlog-6-2-aot-build-size.html
Full changelog: https://github.com/NLog/NLog/releases
For all config options and platform support, check https://nlog-project.org/config/
[#6254] Replace System.Random usage with custom ScatterGenerator. (@jobvk)
Changelog:
NLog v6.2 release notes: https://nlog-project.org/2026/08/16/nlog-6-2-aot-build-size.html
Full changelog: https://github.com/NLog/NLog/releases
For all config options and platform support, check https://nlog-project.org/config/
Your coding agent can read these notes before it upgrades. Set up the MCP server →
[#6215] FileTarget - Added FileLifecycleHooks for extending archive logic. (@Dave-Senn)
Changelog:
NLog v6.2 release notes: https://nlog-project.org/2026/08/16/nlog-6-2-aot-build-size.html
Full changelog: https://github.com/NLog/NLog/releases
For all config options and platform support, check https://nlog-project.org/config/
Improvements
Release notes for NLog v6.2: https://nlog-project.org/2026/08/16/nlog-6-2-aot-build-size.html
16 Aug 2026
NLog v6.2 removes the legacy TypeConverter support for AOT builds, and continues the work started with NLog v6.0 by further reducing filesize by approximately 1 MB for AOT-builds.
NLog used the TypeConverter to convert strings to objects, when loading configuration files. NLog already has built-in support for the common string-to-object conversions, making the general-purpose TypeConverter less needed.
FileTarget now supports FileLifecycleHooks , providing extension points for customizing the lifecycle of log files and the target itself.
Lifecycle hooks can be used to:
Customize initialization — Run custom logic when the FileTarget is initialized.
Customize file streams — Wrap the underlying stream to add encryption, compression, buffering, or other processing.
Process closed files — Perform custom actions when NLog closes an individual log file.
Process files before deletion — Copy, compress, upload, or otherwise process a file before NLog deletes it.
Perform target cleanup — Execute custom cleanup logic when the FileTarget is shut down.
For example, OnFileDeleting can be used to create a ZIP archive of an old log file before NLog deletes it, while OnFileOpened can wrap the output stream to transparently encrypt log data.
ScopeContext has been modified to collect properties in reverse order, so the most recently added properties are processed first.
ScopeContext has always been intended to be an unordered dictionary, with the latest value taking precedence. The new implementation allows the NLog ScopeContext compaction logic to write directly to the final dictionary instead of first allocating and populating a List to preserve dictionary ordering.
When new properties are pushed to ScopeContext , they are pushed to a linked list that lives on the thread’s execution context. The ScopeContext compaction logic prevents this linked list from growing indefinitely when a scope is not popped by the application.
The result is fewer allocations and more efficient processing of ScopeContext properties, especially for applications that make extensive use of scope properties.
NLog ${processinfo} LayoutRenderer is now obsolete, as the dependencies introduced by the .NET Process object can increase the AOT build filesize.
Alternative LayoutRenderers are available:
${processid} - Process Id.
${processname} - Process Name.
${processtime} - Time elapsed since process start.
${processstart} - Process Start Time with support for Format and Culture (New in NLog v6.2).
${gc:WorkingSet} - Process Memory Working Set, including managed and unmanaged memory (New in NLog v6.2).
${gc:TotalMemory} - Process Memory Managed usage only.
NET11 includes additional AOT optimizations for the .NET Process class, which further reduces the AOT build filesize.
If process information is needed that is not provided by the existing LayoutRenderers, a custom LayoutRenderer can be registered.
The NLog.Targets.AtomicFile NuGet package no longer depends on the old Mono.Posix.NETStandard -nuget-package. It now uses open() from libc via DllImport for adding support for MacOSX and Arm64.
Windows : uses FILE_APPEND_DATA together with SYNCHRONIZE .
Linux and macOS : uses open() with O_APPEND and O_CLOEXEC .
O_APPEND ensures that each write is positioned at the end of the file by the operating system.
O_CLOEXEC prevents the file descriptor from being unintentionally inherited across exec() .
New nuget-package NLog.Targets.HttpClient provides HttpClientTarget for sending NLog logevents to HTTP/HTTPS endpoints:
Including features:
HTTP POST, GET, and custom HTTP methods.
Batching multiple log events into a single request.
JSON arrays or newline-delimited JSON (NDJSON) for batched events.
GZip compression.
Custom HTTP headers and authentication.
Client certificates for mutual TLS (mTLS).
HTTP proxy support.
Configurable retry handling for transient HTTP failures.
The target also reuses HttpClient connections for efficient HTTP communication and periodically refreshes the underlying client to detect DNS changes.
This makes HttpClientTarget suitable for sending NLog events to custom HTTP logging services as well as existing HTTP-based log collectors. For example, it can be combined with SplunkLayout to send events to the Splunk HTTP Event Collector (HEC). It can also be combined with EcsLayout to export events to OpenSearch Bulk API.
New nuget-package NLog.Targets.OpenTelemetryHttp for exporting NLog log events directly to an OpenTelemetry Collector or any OTLP/HTTP-compatible endpoint.
Including features:
OpenTelemetry LogRecord body, trace ID, and span ID.
NLog event properties as OpenTelemetry log attributes.
Resource attributes such as service.name, service.version, and host.name.
Standard OpenTelemetry environment variables for endpoint, headers, compression, timeout, service name, and resource attributes.
Batching, payload compression, and retry handling.
OpenTelemetryHttpTarget automatically recognizes the standard OTEL_EXPORTER_OTLP_* environment variables when target properties are not explicitly configured.
If one prefer the OpenTelemetry SDK-based approach, then there is also the awesome community driven NLog.Targets.OpenTelemetryProtocol .
NLog v6 seems to have reached a nice stable point, and the reduction of dependencies has been a move in the right direction. Most users seem happy about the modernizations, even though the rewrite of FileTarget has caused some friction.
The release of the new NLog.Targets.HttpClient and NLog.Targets.OpenTelemetryHttp NuGet-packages should close some gaps and further strengthen the NLog ecosystem.
Looking further ahead there are several ideas worth exploring:
Immutable LogEvent/LogRecord to replace the existing LogEventInfo
Immutable collection of event properties captured only when actually needed.
High resolution UTC timestamps by default.
Culture-invariant message formatting by default.
Together these changes could lead to a new immutable logging pipeline that is both safer and more efficient, while still supporting the existing LogEventInfo pipeline for backwards compatibility.
Another area worth exploring is a non-allocating logging path for common logging scenarios, without paying the cost of capturing execution context, scope properties, and other features unless needed by the configured target output.
NLog should not try to compete with Microsoft.Extensions.Logging as the standard ILogger abstraction or its use of source generators. NLog should remain a standalone logging framework while providing first-class integration with Microsoft.Extensions.Logging.
NLog should complement and extend Microsoft.Extensions.Logging when applications need more than basic console output, providing rich logging features, targets, layouts, and flexible log output.
Return to news
[#6225] AsyncTaskTarget - Fixed bug when using BatchSize=1 and doing explicit flush and next LogEvent fails. (@snakefoot)
Changelog:
NLog v6.0 release notes: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html
Full changelog: https://github.com/NLog/NLog/releases
For all config options and platform support, check https://nlog-project.org/config/
[#6168] PropertiesDictionary - Preserve MessageTemplate property details when adding extra properties. (@snakefoot)
Changelog:
NLog v6.0 release notes: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html
Full changelog: https://github.com/NLog/NLog/releases
For all config options and platform support, check https://nlog-project.org/config/
[#6116] PropertyTypeConverter - Prioritize IFormattable ToString when Format specified. (@snakefoot)
Changelog:
NLog v6.0 release notes: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html
Full changelog: https://github.com/NLog/NLog/releases
For all config options and platform support, check https://nlog-project.org/config/
Improvements
[#6101] LogFactory - Flush / FlushAsync asynchronous completion outside Target lock. (@snakefoot)
Changelog:
NLog v6.0 release notes: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html
Full changelog: https://github.com/NLog/NLog/releases
For all config options and platform support, check https://nlog-project.org/config/
[#5999] JsonLayout - Added support for DottedRecursion. (@thatrajeevkr)
Changelog:
NLog v6.0 release notes: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html
Full changelog: https://github.com/NLog/NLog/releases
For all config options and platform support, check https://nlog-project.org/config/
[#6056] FileTarget - Archive Cleanup sort filenames using natural ordering. (@snakefoot)
Changelog:
NLog v6.0 release notes: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html
Full changelog: https://github.com/NLog/NLog/releases
For all config options and platform support, check https://nlog-project.org/config/
[#6027] FileTarget - Improve archive cleanup when using ArchiveSuffixFormat with datetime. (@snakefoot)
Changelog:
NLog v6.0 release notes: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html
Full changelog: https://github.com/NLog/NLog/releases
For all config options and platform support, check https://nlog-project.org/config/
Improvements
[#5998] FileTarget - Rolling to next directory should not fail. (@snakefoot)
Changelog:
NLog v6.0 release notes: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html
Full changelog: https://github.com/NLog/NLog/releases
For all config options and platform support, check https://nlog-project.org/config/
Improvements #5979 FileTarget - Improve file-wildcard for archive cleanup. ( @snakefoot ) #5980 FileTarget - Extend InternalLogger output with archive
Improvements
- #5952 FileTarget - Close old files when reaching OpenFileCacheSize. (@snakefoot) - #5948 FileTarget - Closing on OpenFileCacheTimeout apply least re
- #5930 XmlParser - Handle XML comments after root-end-tag. (@snakefoot) - #5929 XmlLoggingConfiguration - Improve handling of invalid XML. (@snakefoo
Improvements - #5898 Changed ConditionExpression to be nullable by default since no Condition means no filtering. (@snakefoot) - #5906 Include Conditi
Improvements
Support Ahead-of-Time (AOT) builds without warnings
Major changes:
ReadOnlySpan to reduce memory allocationsFlushAsync and IDisposableAsyncConcurrentWritesArchiveSuffixFormatNLog v6 has reduced its footprint by extracting features into separate nuget-packages:
List of all NLog 6.0 Pull Requests
See also List of major changes in NLog v6 for more details.
Thanks to all contributers: @ana1250, @Pavan8374, @smnsht, @RomanSoloweow, @wadebaird, @hangy, @lavige777, @jokoyoski, @saltukkos, @nih0n, @michaelplavnik, @Aaronmsv, @ShadowDancer, @Orace, @tvogel-nid, @martinzding, @kurnakovv, @dance, @JohnVerheij
Major Changes
NLog v6.0 release notes: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html
List of all NLog 6.0 Pull Requests
Mark struct as readonly to allow compiler optimization
Improvements
Log4JXmlEventLayout - Fixed IncludeEmptyValue for Parameters
Improvements
Fixed NLog XmlParser to support XML comments within XML processing instructions.
Improvements
<IsAotCompatible>ForceWriteLineReadOnlySpan<MessageTemplateParameter>Updated NLog API with enable and introduced Layout.Empty
Improvements
<Nullable>enable</Nullable> and introduced Layout.Empty[RequiredParameter] as obsolete, and replaced with explicit option validation during initialization.LogEventInfo.SequenceID and ${sequenceid} as obsolete, and instead use ${counter:sequence=global}.[OverloadResolutionPriority(-1)] when using C# 13Unless something bad is discovered, then this will be the last preview build, before the final release of NLog v6.0
Updated NLog v6.0 release notes: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html
Support AOT builds without build warnings.
Major Changes
NLog v6.0 release notes: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html
List of all NLog 6.0 Pull Requests
Thanks to all contributers: @ana1250, @Pavan8374, @smnsht, @RomanSoloweow, @wadebaird, @hangy, @lavige777, @jokoyoski, @saltukkos, @nih0n, @michaelplavnik, @Aaronmsv, @ShadowDancer, @Orace, @tvogel-nid, @martinzding, @kurnakovv
- #5858 ConsoleTarget - Added ForceWriteLine to match NLog v6 Schema (@snakefoot) - #5866 Layout.FromLiteral to match NLog v6 (@snakefoot) - #5888 Cha
Improvements
Improvements - #5710 Restored LogFactory.Setup().SetupFromEnvironmentVariables() as not obsolete (#5710) @snakefoot - #5717 Avoid using MakeGenericTyp
Improvements
Improvements - #5698 Fix AppDomain BaseDirectory on NET9 when it returns Long UNC (#5698) (@snakefoot) - #5700 AsyncTaskTarget - Reduce default thrott
Improvements
Improvements - #5572 Layout.FromMethod that supports typed Layout (#5572) (@smnsht) - #5580 Layout.FromMethod that supports typed Layout (without boxi
Improvements
Improvements - #5548 FileTarget - Reset reusable MemoryStream when above max capacity (#5548) (@RomanSoloweow) - #5568 ThreadIdLayoutRenderer - Added
Improvements
Bug Fix - #5515 Fix NullReferenceException when using LoggingRules with filters and no targets (#5515) (@snakefoot)
Bug Fix
Improvements - #5313 CallSite can hide single class type using AddCallSiteHiddenClassType (#5313) (@wadebaird) - #5489 Logging Rule with FinalMinLevel
Improvements
Nothing published for this version
Improvements - #5450 ConfigurationItemFactory - Skip type attribute lookup for official types (#5450) (@snakefoot) - #5441 LoggingRule - ToString shou
Improvements
Improvements - #5427 FileTarget - Fix Windows FileSystem Tunneling when KeepFileOpen=false (#5427) (@snakefoot) - #5422 AppEnvironmentWrapper - Added
Improvements
Improvements - #5407 FileTarget - Added option WriteHeaderWhenInitialFileNotEmpty (#5407) (@RomanSoloweow) - #5381 FileTarget - Removed explicit File.
Improvements
Improvements - #5344 ConcurrentRequestQueue - Reduced SpinCount to 15, before monitor wait (#5344) (@snakefoot) - #5347 ConfigurationItemFactory - Imp
Improvements
Improvements - #5316 ObjectPath should only render output when finding property-value (#5316) (@snakefoot) - #5318 Typed Layout parses empty string as
Improvements
Improvements - #5308 AutoFlushTargetWrapper - Explicit flush should also await when FlushOnConditionOnly (#5308) (@snakefoot) - #5301 Target precalcul
Improvements
Improvements - #5276 ConfigurationItemFactory - Fix NullReferenceException when skipping already loaded assembly (#5276) (@snakefoot)
Improvements
Improvements - #5191 WrapperTarget - Derive Name from wrappedTarget (#5248) (@snakefoot) - #5249 Updated obsolete warning for ConfigurationReloaded-ev
Improvements
See also: NLog v5.2 without trim warnings, and obsoleted methods.
Improvements
See also: NLog v5.2 without trim warnings, and obsoleted methods.
Improvements - #5229 TargetWithContext - Fixed ScopeContext capture when multiple wrappers (#5229) (@snakefoot) - #5227 DefaultJsonSerializer - Cache
Improvements
Improvements - #5207 FileTarget - Recover from file-deleted when same archive-folder (#5207) (@snakefoot) - #5201 NLog.xsd schema with support for var
Improvements
Improvements - #5174 LoggingRule - FinalMinLevel with Layout support (#5174) (@Aaronmsv) - #5177 MailTarget - Added support for email message headers
Improvements
Improvements - #5157 FileTarget - Archive Dynamic FileName ordering ignore case (#5157) (@snakefoot) - #5150 EventLogTarget - EventId with LogEvent Pr
Improvements
Improvements - #5134 XmlLayout - Added Layout-option to XmlElement to match XmlAttribute (#5134) (@snakefoot) - #5126 JsonLayout - Avoid NullReference
Improvements
Improvements - #5102 MessageTemplates ValueFormatter with support for ISpanFormattable (#5102) (@snakefoot) - #5101 Add LogEventDropped handler to the
Improvements
Improvements - #5092 InternalLogger - LogFile expand filepath variables (#5092) (@RyanGaudion) - #5090 ReplaceNewLines - Support Replacement with newl
Improvements
Fixes - #5051 Fixed embedded resource with ILLink.Descriptors.xml to avoid IL2007 (#5051) (@snakefoot)
Fixes
Improvements - #5034 Added embedded resource with ILLink.Descriptors.xml to skip AOT (#5034) (@snakefoot) - #5035 Layout Typed that can handle LogEven
Improvements - #5019 Layout Typed validates fixed values upfront at config initialization, instead of when logging (#5019) (@snakefoot) - #5026 Remove
Improvements
Improvements - #4938 LoggingConfigurationParser should alert when LoggingRule filters are bad (#4938) (@snakefoot) - #4940 CompoundLayout with layout
Improvements
Deprecated NLog.Extended nuget-package
See Release post
Details of changes: See here
See rationale here
For a full list of all the enhancements and performance improvements: NLog 5.0 Pull Requests
Thank you: @snakefoot, @304NotModified, @ThomasArdal, @mickelsonmichael, @TalAloni, @njqdev, @menishmueli, @ErickJeffries, @AlanLiu90, @aled, @tetrodoxin, @noamyogev84, @simoneserra93, @sjafarianm, @Orace, @GitHubPang, @KurnakovMaksim
See List of major changes in NLog 5.0.
Improvements
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.