NLog v4.7 Release Notes

Release Date: 2019-03-20 // about 5 years ago
  • ๐Ÿ”‹ Features

    • ๐Ÿ”ง #3686 + #3740 LogManager.Setup() allows fluent configuration of LogFactory options (@snakefoot + @304NotModified)
    • 0๏ธโƒฃ #3610 LogManager.Setup().SetupSerialization(s => s.RegisterObjectTransformation(...)) for overriding default property reflection (@snakefoot + @304NotModified + @Giorgi + @mmurrell)
    • #3787 LogManager.Setup().SetupExtensions(s => s.RegisterConditionMethod(...)) can use lambda methods and not just static methods (@snakefoot)
    • #3713 ${level:format=FullName} will expand Info + Warn to their full name (@snakefoot)
    • ๐Ÿ‘ #3714 + #3734 FileTarget - Supports MaxArchiveDays for cleanup of old files based on their age (@snakefoot)
    • #3737 + #3769 Layout.FromMethod to create Layout directly from a lambda method (@snakefoot)
    • ๐Ÿ“œ #3771 Layout.FromString to create Layout directly from string along with optional parser validation (@snakefoot)
    • #3793 ${dir-separator} for rendering platform specific directory path separator (@304NotModified)
    • ๐Ÿ‘ #3755 FileTarget - Supports ArchiveOldFileOnStartupAboveSize for cleanup of existing file when above size (@Sam13)
    • #3796 + #3823 InternalLogger - Added LogMessageReceived event (@304NotModified + @snakefoot)
    • #3829 DatabaseTarget - Assign connection properties like SqlConnection.AccessToken (@304NotModified + @snakefoot)
    • #3839 DatabaseTarget - Assign command properties like SqlCommand.CommandTimeout (@snakefoot)
    • ๐ŸŒฒ #3833 ${onHasProperties} for only rendering when logevent includes properties from structured logging (@snakefoot)

    ๐Ÿ‘Œ Improvements

    • #3521 XmlLoggingConfiguration - Marked legacy constructors with ignoreErrors parameter as obsolete (@snakefoot)
    • ๐Ÿ‘ #3689 LoggingConfiguration - Perform checking of unused targets during initialization for better validation (@snakefoot)
    • ๐ŸŒฒ #3704 EventLogTarget - Improve diagnostics logging when using dynamic EventLog source (@snakefoot)
    • ๐Ÿ‘ #3706 ${longdate} now also supports raw value for use as DatabaseTarget parameter with DbType (@snakefoot)
    • #3728 SourceLink for GitHub for easy debugging into the NLog source code (@304NotModified)
    • #3743 JsonLayout - EscapeForwardSlash now automatically applies to sub-attributes (@snakefoot)
    • #3742 TraceTarget - Introduced EnableTraceFail=false to avoid Environment.FailFast (@snakefoot)
    • ๐Ÿ“œ #3750 ExceptionLayoutRenderer - Improved error message when Format-token parsing fails (@snakefoot)
    • 0๏ธโƒฃ #3747 AutoFlushWrapper - Set AutoFlush=false for AsyncTaskTarget by default (@snakefoot)
    • #3754 LocalIpAddressLayoutRenderer - Higher priority to network-addresses that has valid gateway adddress (@snakefoot)
    • #3762 LogFactory - Flush reports to InternalLogger what targets produces timeouts (@snakefoot)

    ๐Ÿ›  Bugfixes

    • #3758 LogFactory - Fix deadlock issue with AutoReload (@snakefoot)
    • ๐Ÿ›  #3766 JsonLayout - Fixed ThreadAgnostic to correctly capture context when using nested JsonLayout (@snakefoot)
    • ๐Ÿ›  #3700 ExceptionLayoutRenderer - Fixed so Format option HResult also works for NetCore (@snakefoot)
    • #3761 + #3784 Log4JXml Layout will render NDLC + NDC scopes in correct order (@adanek + @304NotModified)
    • ๐Ÿ‘ป #3821 Logger - Added exception handler for CallSite capture for platform that fails to capture StackTrace (@snakefoot)
    • ๐Ÿ›  #3835 StringSplitter - Fixed quote handling when reading elements for config list-properties (@snakefoot)
    • ๐Ÿ‘€ #3828 Utilities: fix ConversionHelpers.TryParseEnum for white space (@304NotModified)

    ๐ŸŽ Performance

    • ๐Ÿ”’ #3683 ObjectGraphScanner - Avoid holding list.SyncRoot lock while scanning (@snakefoot)
    • #3691 FileTarget - ConcurrentWrites=true on NetCore now much faster when archive enabled (@snakefoot)
    • #3694 + #3705 JsonConverter - Write DateTime directly without string allocation (@snakefoot)
    • ๐Ÿšš #3692 XmlLayout - Removed unnecessary double conversion to string (@snakefoot)
    • #3735 WebServiceTarget - Reduced memory allocations by removing unnecessary delegate capture (@snakefoot)
    • #3739 NetworkTarget - Reduced memory allocation for encoding into bytes without string allocation (@snakefoot)
    • 0๏ธโƒฃ #3748 AsyncTaskTarget - Skip default AsyncWrapper since already having internal queue (@snakefoot)
    • #3767 Mark Condition Expressions as ThreadSafe to improve concurrency in Layouts (@snakefoot)
    • ๐ŸŽ #3764 DatabaseTarget - Added IsolationLevel option that activates transactions for better batching performance (@snakefoot)
    • ๐Ÿ›  #3779 SimpleLayout - Assignment of string-reference with null-value will translate into FixedText (@304NotModified)
    • โฑ #3790 AsyncWrapper - Less aggressive with scheduling timer events for background writing (@snakefoot)
    • #3830 Faster assignment of properties accessed through reflection (@304NotModified)
    • ๐Ÿ‘ #3832 ${replace} - Faster search and replace when not explicitly have requested regex support (@snakefoot)
    • #3828 Skip need for Activator.CreateInstance in DbTypeSetter (@304NotModified)