NLog 6.0 released
21 Jun 2025NLog v6 with the following major changes:
- Support Ahead-of-Time (AOT) builds without warnings
- Support Nullable references
- Support ReadOnlySpan to reduce memory allocations
- LogFactory supports FlushAsync and IDisposableAsync
- FileTarget removed support for ConcurrentWrites
- FileTarget refactored file-archive-logic with ArchiveSuffixFormat
NLog v6 reducing its footprint by extracting features into separate nuget-packages:
- NLog.Targets.AtomicFile - ConcurrentWrites using atomic file-append from operating system API.
- NLog.Targets.ConcurrentFile - Original FileTarget with ConcurrentWrites using global mutex from operating system API.
- NLog.Targets.GZipFile - EnableArchiveFileCompression using GZipStream for writing GZip compressed log-files.
- NLog.Targets.Mail - Depends on System.Net.Mail.SmtpClient.
- NLog.Targets.Network - Depends on TCP and UDP Network Socket, and adds support for Syslog and Graylog.
- NLog.Targets.Trace - Depends on System.Diagnostics.TraceListener and System.Diagnostics.Trace.CorrelationManager.
- NLog.Targets.WebService - Depends on System.Net.Http.HttpClient.
- NLog.RegEx - Depends on System.Text.RegularExpressions which is a huge dependency for a logging library.
See also List of major changes in NLog v6 for more details.
Many other improvements
Full list of all changes: NLog 6.0 Pull Requests
Comments and feedback are welcome.
Credits
Additional thanks to all contributers, since last major release: