Upgrading NLog 5 to 6
Breaking5.5.1 → 6.2.2Breaking26Deprecated7New31Changed115Fixed45Other29
24 breaking changes.
- A ScopeContext option has a new name, so code using the old name must be updated.
- The NLogViewer alias for the Log4JXml target is gone, so configurations using it must switch to the real name.
- The Chainsaw target has a new name, so configurations referencing the old name must be updated.
- The default file target no longer handles concurrent writes, though it can still keep files open.
Target frameworks requirement changed in 6.0.0-preview1: .NETFramework3.5, .NETFramework4.5, .NETFramework4.6, .NETStandard1.3, .NETStandard1.5, .NETStandard2.0 → .NETFramework3.5, .NETFramework4.5, .NETFramework4.6, .NETStandard2.0, .NETStandard2.1.
Drops netstandard.library, system.componentmodel.primitives, system.componentmodel.typeconverter, system.data.common, system.diagnostics.process, system.diagnostics.stacktrace, system.diagnostics.tracesource, system.io.filesystem.watcher, system.net.http, system.net.nameresolution, system.net.requests, system.reflection.typeextensions, system.runtime.loader, system.text.regularexpressions, system.threading.thread, system.xml.xmldocument.
What you must change
ScopeContextCaptureNestedContextCloneNestedContextLog4JXmlTargetNLogViewerChainsawTargetLog4JXmlTargetLog4JXmlEventLayoutFileTargetConcurrentWritesKeepFileOpenSystem.Text.RegularExpressionsNLog.RegExNLog.WindowsRegistryNLog.Targets.TraceNLog.Targets.ConcurrentFileNLog.Targets.DatabaseNLog.Targets.MailNLog.Targets.WebServiceNLog.Targets.AtomicFileFileTargetConcurrentWritesNLog.Targets.ConcurrentFileFileTargetArchiveSuffixFormatNLog.Targets.GZipFileFileTargetEnableArchiveFileCompressionGZipStreamNLog.Targets.MailMailTargetSystem.Net.Mail.SmtpClientNLog.Targets.NetworkNetworkTargetNLog.Targets.TraceTraceTargetNLogTraceListenerSystem.Diagnostics.TraceListenerSystem.Diagnostics.TraceNLog.Targets.WebServiceWebServiceTargetSystem.Net.Http.HttpClientNLog.RegExSystem.Text.RegularExpressionsFileTargetNLog.Targets.ConcurrentFileMailTargetNLog.Targets.MailNetworkTargetNLog.Targets.NetworkTraceTargetNLogTraceListenerNLog.Targets.TraceWebServiceTargetNLog.Targets.WebServiceDeprecations to plan for
ConfigurationItemFactoryParseMessageTemplatesConditionParserSimpleLayoutRenderersConversionHelpers.TryParseEnumCallSiteLayoutRendererCleanNamesOfAnonymousDelegatesCleanNamesOfAsyncContinuation[RequiredParameter] as obsolete and replaces it with explicit option validation during initialization.RequiredParameterLogEventInfo.SequenceID and ${sequenceid} as obsolete, recommending ${counter:sequence=global} instead.LogEventInfo.SequenceID${sequenceid}${counter:sequence=global}