Skip to content

Releases: NLog/NLog

NLog 6.2.1

Choose a tag to compare

@snakefoot snakefoot released this 16 Sep 16:52
b058028

Improvements

  • #6254 Replace System.Random usage with custom ScatterGenerator. (@jobvk)
  • #6267 JsonLayout - Escape lone surrogates so output stays valid UTF8. (@dylanpulver)
  • #6275 XML docs with Default value for class properties in Filters namespace. (@dualfroz)
  • #6276 XML docs with Default value for class properties with unit test. (@snakefoot)
  • #6265 AtomicFileTarget - Improve recovery when file suddenly disappears. (@snakefoot)
  • #6266 JsonLayout - Explicit assigned SuppressSpaces should win. (@snakefoot)
  • #6271 DefaultJsonSerializer - Refactor AppendStringEscape to make method simpler. (@snakefoot)
  • #6268 XmlHelper - Replace with char.IsHighSurrogate + char.IsLowSurrogate. (@snakefoot)
  • #6269 XmlHelper - Improve CDATA encoding when first char is invalid. (@snakefoot)
  • #6273 XmlHelper - Check char.IsHighSurrogate before checking length. (@snakefoot)
  • #6251 LogManager - Remove CLSCompliant(false) attribute from GetCurrentClassLogger. (@snakefoot)
  • #6255 NLog.Schema - NLog.Targets.HttpClient + NLog.Targets.OpenTelemetryHttp. (@snakefoot)
  • #6261 XmlParser - Moved primitive parsing logic into InputCursor. (@snakefoot)
  • #6264 XmlParser - Optimize parsing of Attributes and InnerText and CDATA. (@snakefoot)
  • #6280 Layout - FromLiteral is IsInitialized from the start and ThreadAgnostic. (@snakefoot)

NLog 6.2

Choose a tag to compare

@snakefoot snakefoot released this 16 Aug 20:57
d38a12a

Improvements

  • #6215 FileTarget - Added FileLifecycleHooks for extending archive logic. (@Dave-Senn)
  • #6218 ScopeContext - Optimize collection of properties in reverse order. (@snakefoot)
  • #6230 PropertyTypeConverter - Disable legacy TypeDescriptor when AOT. (@snakefoot)
  • #6231 Replacing ProcessInfo-LayoutRenderer with ProcessStart-LayoutRenderer. (@snakefoot)
  • #6229 GarbageCollectorInfoLayoutRenderer - WorkingSet + Format. (@snakefoot)
  • #6246 AsyncTaskTarget - Added Jitter on Retry to reduce thundering herd. (@snakefoot)
  • #6248 AsyncTaskTarget - Changed Jitter to use Stopwatch instead of TickCount. (@snakefoot)
  • #6245 AsyncTaskTarget - Refactor to reduce code complexity. (@snakefoot)
  • #6148 AppEnvironmentWrapper - Return Unknown_ProcessId when empty ProcessName. (@snakefoot)
  • #6187 ConfigurationItemFactory - Marked ParseMessageTemplates as obsolete. (@snakefoot)
  • #6243 ConditionParser - Marked as obsolete, so it can become internal. (@snakefoot)
  • #6087 Target - Reduce code complexity of WriteAsyncLogEvents. (@snakefoot)
  • #6200 SimpleLayout - Marked Renderers-property as obsolete. (@snakefoot)
  • #6239 LogFactory - FlushAsync and DisposeAsync with explict usage of CancellationToken.None. (@snakefoot)

Release notes for NLog v6.2: https://nlog-project.org/2026/08/16/nlog-6-2-aot-build-size.html

NLog 6.1.4

Choose a tag to compare

@snakefoot snakefoot released this 08 Jul 18:06
a342b92

Improvements

  • #6225 AsyncTaskTarget - Fixed bug when using BatchSize=1 and doing explicit flush and next LogEvent fails. (@snakefoot)
  • #6206 MruCache - Changed to ConcurrentDictionary but still single writer. (@snakefoot)
  • #6205 TargetWithFilterChain - Increase CallSite MaxCapacity from 1000 to 2000. (@snakefoot)
  • #6197 JsonAttribute - New constructor with JsonLayout and Encode = false. (@snakefoot)
  • #6174 Reduce AOT file-size. Changed PropertyTypeConverter to avoid Dictionary for conversion mapping. (@snakefoot)
  • #6177 Reduce AOT file-size. Changed LogFactory PurgeObsoleteLoggers to clone Dictionary instead of ToList. (@snakefoot)
  • #6185 Reduce AOT file-size. Changed to use yield instead of Linq. (@snakefoot)
  • #6188 Reduce AOT file-size. Changed ConfigurationItemFactory from Dictionary to Array of PropertyInfo. (@snakefoot)
  • #6192 Reduce AOT file-size. Changed Target FindAllLayouts to use HashSet instead of Linq Distinct. (@snakefoot)
  • #6193 Reduce AOT file-size. Changed XmlLoggingConfiguration AutoReloadFileNames to use yield instead of Linq. (@snakefoot)
  • #6195 Reduce AOT file-size. Changed LoggingConfiguration CheckUnusedTargets to use HashSet instead of Linq. (@snakefoot)
  • #6204 TemplateEnumerator - Replace LiteralHole with CurrentHole and CurrentLiteral. (@snakefoot)
  • #6223 XmlParser - ReadUntilChar avoid extra string-allocation on trim InnerText. (@snakefoot)
  • #6222 XmlParser - Simplify ReadUntilChar by extracting parse of attribute-name into ReadEntityName. (@snakefoot)
  • #6209 AppVeyor - Visual Studio 2026. (@snakefoot)
  • #6199 Fixed nullable warnings from Activator.CreateInstance. (@snakefoot)
  • #6190 SetupConfigurationTargetBuilder - Fix Sonar Code Smell. (@snakefoot)
  • #6176 TryNLogSpecificConversion - Refactor parsing Layout from string. (@snakefoot)
  • #6210 ScopeContext - Fix List capacity for GetAllNestedStates. (@jnyrup)
  • #6211 ScopeContext - Renamed PushNestedState to CollectNestedState. (@snakefoot)
  • #6214 ScopeContext - Rename CaptureNestedContext to CloneNestedContext. (@snakefoot)
  • #6216 ScopeContext - Simplify CaptureContextProperties when only nested state. (@snakefoot)
  • #6217 ScopeContext - Unify CollectNestedState implementation. (@snakefoot)

NLog 6.1.3

Choose a tag to compare

@snakefoot snakefoot released this 04 May 22:16
7f18a90

Improvements

  • #6168 PropertiesDictionary - Preserve MessageTemplate property details when adding extra properties. (@snakefoot)
  • #6149 LoggingRule - Updating FinalMinLevel should also update MinLevel when same LogLevel. (@snakefoot)
  • #6165 AsyncTaskTarget - Retry with help from Task.Delay. (@snakefoot)
  • #6164 DateLayoutRenderer - UniversalTime = false should only convert to local when UTC. (@snakefoot)
  • #6138 SimpleLayout skip Precalculate when INoAllocationStringValueRenderer available. (@reabr)
  • #6158 TemplateEnumerator - Optimize ParseTextPart by direct calling IndexOfAny. (@snakefoot)
  • #6152 TemplateEnumerator - Optimize parsing of single digit holename. (@snakefoot)
  • #6142 InternalLogger - Skip allocating params array when no exception. (@snakefoot)
  • #6145 InternalLogger - Handle Exception ToString can throw with AOT. (@snakefoot)
  • #6154 ColoredConsoleTarget - Optimize Console Coloring for Word Highlight. (@snakefoot)
  • #6159 ColoredConsoleTarget - Reset capture of previous colors after ResetDefaultColors. (@snakefoot)
  • #6140 TryParseEnum - Apply Enum.TryParse since better for AOT. (@snakefoot)
  • #6143 Fixed various issues reported by EnableNETAnalyzers. (@snakefoot)

NLog 6.1.2

Choose a tag to compare

@snakefoot snakefoot released this 01 Apr 06:35
24518ac

Improvements

  • #6116 PropertyTypeConverter - Prioritize IFormattable ToString when Format specified. (@snakefoot)
  • #6129 GZipFile - Support Header / Footer / WriteBom. (@snakefoot)
  • #6126 FileTarget - Alert when FileName needs to be repaired. (@snakefoot)
  • #6113 FileTarget - Upfront validation of ArchiveSuffixFormat property. (@snakefoot)
  • #6110 FileTarget - Improve repair of legacy ArchiveFileName. (@snakefoot)
  • #6107 LoggingRule - Added WriteTo-method to match NLog.config. (@snakefoot)
  • #6106 LoggingRule - Added MinLevel-property to match NLog.config. (@snakefoot)
  • #6118 LoggingRule - Update FinalMinLevel-property to match NLog.config. (@snakefoot)
  • #6123 Layout.IsNullOrEmpty similar to string.IsNullOrEmpty. (@snakefoot)
  • #6119 TargetPropertyWithContext - Added alias Value for Layout. (@snakefoot)
  • #6132 TargetPropertyWithContext - ToString returns Name and Value. (@snakefoot)
  • #6105 MessageTemplateParameters - Reduce code complexity. (@snakefoot)
  • #6131 + #6133 Refactor NLog source code to fix nullable warnings. (@snakefoot)

NLog 6.1.1

Choose a tag to compare

@snakefoot snakefoot released this 28 Feb 15:55
0e83056

Improvements

  • #6101 LogFactory - Flush / FlushAsync asynchronous completion outside Target lock. (@snakefoot)
  • #6100 NLog.Targets.AtomicFile supporting NetStandard2 with Win32 API. (@michailf)
  • #6094 XmlLayout - Faster XML encoding with INoAllocationStringValueRenderer. (@snakefoot)
  • #6091 LiteralWithRawValueLayoutRenderer - Only support RawValue when possible. (@snakefoot)
  • #6088 CachedLayoutRendererWrapper - Allow literal optimization when caching not needed. (@snakefoot)

NLog 6.1

Choose a tag to compare

@snakefoot snakefoot released this 31 Jan 19:18
5b18465

Improvements

  • #5999 JsonLayout - Added support for DottedRecursion. (@thatrajeevkr)
  • #6084 JsonLayout - Protect against cyclic object graphs when DottedRecursion. (@snakefoot)
  • #6075 DebuggerTarget - Add support for MaxMessageSize and OnOverflow-action. (@snakefoot)
  • #6070 InternalLogger - Auto enable LogLevel.Info when activated. (@snakefoot)
  • #6045 LoggingConfigurationParser - Report unrecognized options in targets and rules section. (@snakefoot)
  • #6059 LogEventBuilder - Properties with IReadOnlyCollection for initialCapacity. (@snakefoot)
  • #6065 FileTarget - Adjust ArchiveSuffixFormat to better handle legacy ArchiveFileName. (@snakefoot)
  • #6079 FileTarget - Replace Environment.TickCount with LogEventInfo.TimeStamp. (@snakefoot)
  • #6066 FileTarget - Simplify FileName natural ordering logic. (@snakefoot)
  • #6069 FileTarget - Reduce code complexity for NaturalStringComparer. (@snakefoot)
  • #6064 FileTarget - Reduce code complexity for ArchiveNumbering property. (@snakefoot)
  • #6082 JsonLayout - Faster Json encoding with INoAllocationStringValueRenderer. (@snakefoot)
  • #6083 CsvLayout - Faster CSV encoding with INoAllocationStringValueRenderer. (@snakefoot)
  • #6081 DefaultJsonSerializer - Reduce overhead of PerformJsonEscapeWhenNeeded. (@snakefoot)
  • #6025 LogEventInfo - Changed LayoutCache from dictionary to linked list. (@snakefoot)
  • #6049 PropertiesDictionary - Increase initial capacity when insert. (@snakefoot)
  • #6061 PropertiesDictionary - Simplify enumerator when mixing property types. (@snakefoot)
  • #6074 WhenEmpty - Optimize when IsFixedText. (@snakefoot)
  • #6062 BufferingTargetWrapper - Improve InternalLogger output when WrappedTarget is NULL. (@snakefoot)
  • #6067 Fix nullable warnings from NET10 annotations. (@snakefoot)
  • #6068 Support nullable where TKey : notnull for dictionary. (@snakefoot)
  • #6071 AssemblyExtensionTypes - Reduce code complexity. (@snakefoot)
  • #6072 LoggingConfigurationFileLoader - Handle unknown type loading for App.config. (@snakefoot)
  • #6076 Marked ConversionHelpers.TryParseEnum as obsolete. (@snakefoot)
  • #5949 CallSiteLayoutRenderer - Obsoleted CleanNamesOfAnonymousDelegates + CleanNamesOfAsyncContinuation. (@snakefoot)

NLog 6.0.7

Choose a tag to compare

@snakefoot snakefoot released this 09 Dec 08:04
4dd16e8

Improvements

  • #6056 FileTarget - Archive Cleanup sort filenames using natural ordering. (@snakefoot)
  • #6054 EventProperties - Format Dictionary Properties correctly. (@snakefoot)
  • #6051 Failure to create config item should be reported as InternalLogger Error. (@snakefoot)
  • #6052 PropertiesDictionary - Faster TryGetValue without IsEmpty. (@snakefoot)
  • #6048 PropertiesDictionary - Increase initial capacity when insert. (@snakefoot)
  • #6047 LogEventInfo - Minor optimization of HasImmutableProperties. (@snakefoot)
  • #6057 WhenEmpty - Support AppDomainFixedOutput optimization. (@snakefoot)
  • #6053 JsonAttribute - Reduce code complexity when Encode = false. (@snakefoot)
  • #6044 Target also enforce PreventMultipleCalls when WriteFailedNotInitialized. (@snakefoot)
  • #6042 NLog.RegEx - Fixed Wiki-link in nuget-package. (@snakefoot)

NLog 6.0.6

Choose a tag to compare

@snakefoot snakefoot released this 09 Nov 15:14
1913a82

Improvements

  • #6027 FileTarget - Improve archive cleanup when using ArchiveSuffixFormat with datetime. (@snakefoot)
  • #6028 FileTarget - Fix archive cleanup when only single old file and using MaxArchiveDays. (@snakefoot)
  • #6039 FileTarget - Render ArchiveSuffixFormat using NLog DefaultCultureInfo. (@snakefoot)
  • #6030 ObjectReflectionCache - Improve handling of JObject serialization. (@snakefoot)
  • #6026 JsonLayout - Reduce code complexity for rendering JsonAttribute. (@snakefoot)
  • #6036 NullTarget - Improve thread concurrency when FormatMessage = false. (@snakefoot)
  • #6023 MemoryTarget - Apply MaxLogsCount limit on next LogEvent. (@snakefoot)
  • #6040 XmlParser - Refactor to reduce code complexity. (@snakefoot)
  • #6041 ScopeContextAsyncState - Refactor to reduce code complexity. (@snakefoot)

NLog 6.0.5

Choose a tag to compare

@snakefoot snakefoot released this 09 Oct 06:21
a023270

Improvements

  • #5998 FileTarget - Rolling to next directory should not fail. (@snakefoot)
  • #6013 ValueFormatter - Skip quotes for CaptureType.Stringify unless legacy mode. (@snakefoot)
  • #6007 ColoredConsoleTarget - Use Span to reduce string-allocation for word-highlighting. (@snakefoot)
  • #6009 NullTarget - Avoid string-allocation upfront when FormatMessage = true. (@snakefoot)
  • #6012 XmlLoggingConfiguration - Reduce output for InternalLogger Info-Level. (@snakefoot)
  • #6006 XmlLoggingConfiguration - Protect against double dispose of AutoReloadConfigFileWatcher. (@snakefoot)
  • #6008 LoggerImpl - Merge WriteToTargetWithFilterChain into Write. (@snakefoot)
  • #6010 LoggingConfiguration - Redirect AddRuleForOneLevel and AddRuleForAllLevels to AddRule. (@snakefoot)
  • #6011 LoggingRule - Align EnableLoggingForLevels to skip when minLevel is LogLevel.Off. (@snakefoot)
  • #6015 CompoundLayout - Changed to foreach for better release optimizations. (@snakefoot)
  • #6016 CsvLayout - Changed to foreach for better release optimizations. (@snakefoot)
  • #6017 JsonArrayLayout - Changed to foreach for better release optimizations. (@snakefoot)
  • #6018 XmlLayout - Changed to foreach for better release optimizations. (@snakefoot)