You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2025-04-29-nlog-6-0-major-changes.md
+19-23Lines changed: 19 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,6 +131,23 @@ await using var logFactory = NLog.LogManager.Setup().LoadConfigurationFromFile()
131
131
The NLog LogFactory `Dispose()`-method has been changed to skip flush with help from worker-threads,
132
132
but will only perform synchronous NLog Target Close.
133
133
134
+
### NLog API with nullable references
135
+
NLog API has been updated to enable nullable, and has been compiled using C# v9 for all target-platforms.
136
+
137
+
NET3 introduced C# v8 with support for nullable reference types, that allows static analysis to avoid
138
+
NullReferenceException (NRE). NET5 introduced C# v9 with improved support for nullable generics.
139
+
140
+
This will improve the user-experience, when using the NLog API directly instead of NLog configuration files.
141
+
142
+
### NLog Logger API with ReadOnlySpan
143
+
NLog Logger now supports `params ReadOnlySpan` and can skip `params object[]`-allocation, when many parameters
144
+
and LogLevel is not enabled.
145
+
146
+
NET9 introduced C# v13 that introduced `params ReadOnlySpan`, which is now supported by NLog for NetStandard2.1.
147
+
148
+
NLog extends the optimization to completely skip the `params object[]`-allocation, when using message-templates
149
+
and it is not possible to defer the parsing of the message-template on background thread.
150
+
134
151
### NLog GelfTarget and GelfLayout
135
152
136
153
The [NLog.Targets.Network](https://www.nuget.org/packages/NLog.Targets.Network) nuget-package also includes support for the Graylog Extended Log Format (GELF).
@@ -148,7 +165,7 @@ custom property-names with underscore `_`.
0 commit comments