NLog 4.6.0-rc2

NLog for .NET Framework and .NET Standard

NLog is a logging platform for .NET with rich log routing and management capabilities.
NLog supports traditional logging, structured logging and the combination of both.

Supported platforms:

- .NET Framework 3.5, 4, 4.5, 4.6, 4.7 & 4.8
- .NET Standard 1.3+ and 2.0+;
- .NET Framework 4 client profile
- Xamarin Android, Xamarin iOs
- UWP
- Windows Phone 8
- Silverlight 4 and 5
- Mono 4

For ASP.NET Core, check: https://www.nuget.org/packages/NLog.Web.AspNetCore

This is a prerelease version of NLog.
There is a newer version of this package available.
See the version list below for details.
Install-Package NLog -Version 4.6.0-rc2
dotnet add package NLog --version 4.6.0-rc2
paket add NLog --version 4.6.0-rc2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

## Changes since RC1

### Breaking

Breaking changes since NLog 4.6 RC1, no breaking changes with 4.5.11

- #3131 DatabaseTarget - Removed logEvent-parameter from CreateDatabaseParameter (@snakefoot)
- #3138 Split XML layout to XMLELement and XmlElementBase (#3138) (@304NotModified)

### Features

- #3124 NetworkTarget - Added support for KeepAliveTimeSeconds (@snakefoot)
- #3129 ConfigSetting - Preregister so it can be accessed without extension registration (#3129) (@snakefoot)

### Improvements

- #3162 ContextProperty with IncludeEmptyValue means default value for ValueType (#3162) (@snakefoot)
- #3160 Refactor filetarget + target to reduce code complexity (@snakefoot)
- #3159 AppSettingLayoutRenderer - Include Item for NLog.Extended (@snakefoot)
- #3155 PlatformDetector - Introduced detection of MacOSX, and removed WindowsCE (@snakefoot)
- #3144 TryGetRawValue instead of GetRawValue (@304NotModified)
- #3141 AppSettingLayoutRenderer2 - Use Item instead of Name as it matches GDC + MDC + MDLC (#3141) (@snakefoot)
- #3121 All Hyperlinks to https (@304NotModified)

## All changes NLog 4.6

### Features

* #2363 + #2899 + #3085 + #3091 Database target: support for DbType for parameters (including SqlDbType) -  (@hubo0831,@ObikeDev,@sorvis, @304NotModified, @snakefoot)
* #2610 AsyncTargetWrapper with LogEventDropped- + LogEventQueueGrow-events (@Pomoinytskyi)
* #2670 + #3014 XmlLayout - Render LogEventInfo.Properties as XML (@snakefoot)
* #2678 NetworkTarget - Support for SSL & TLS (@snakefoot)
* #2709 XML Config: Support for constant variable in level attributes (level, minlevel, etc) (@304NotModified)
* #2848 Added defaultAction for <filter> (@304NotModified)
* #2849 IRawValue-interface and ${db-null} layout renderer (@304NotModified)
* #2902 JsonLayout with support for System.Dynamic-objects (@304NotModified)
* #2907 New Substring, Left & Right Wrappers (@304NotModified)
* #3098 <rule> support for one or more '*' and '?' wildcards and in any position  (@beppemarazzi)
* #2909 AsyncTaskTarget - BatchSize + RetryCount (@snakefoot)
* #3018 ColoredConsoleTarget - Added EnableAnsiOutput option (VS Code support) (@jp7677 + @snakefoot)
* #3031 + #3092 Support ${currentdir},${basedir},${tempdir} and Environment Variables for internalLogFile when parsing nlog.config (@snakefoot)
* #3050 Added IncludeGdc property in JsonLayout (@casperc89)
* #3071 ${HostName} Layout Renderer for full computer DNS name (@amitsaha)
* #3053 ${AppSetting} Layout Renderer (app.config + web.config) moved from NLog.Extended for NetFramework (@snakefoot)
* #3060 TargetWithContext - Support for PropertyType using IRawValue-interface (@snakefoot)

### Enhancements

* #2989 JsonLayout includes Type-property when rendering Exception-object (@snakefoot)
* #2891 LoggingConfigurationParser - Extracted from XmlLoggingConfiguration (Prepare for appsettings.json)  (@snakefoot)
* #2910 Added support for complex objects in MDLC and NDLC on Net45  (@snakefoot)
* #2918 PerformanceCounter - Improve behavior for CPU usage calculation  (@snakefoot)
* #2941 TargetWithContext - Include all properties even when duplicate names  (@snakefoot)
* #2974 Updated resharper annotations for better validation (@imanushin)
* #2979 Improve default reflection support on NetCore Native (@snakefoot)
* #3017 EventLogTarget with better support for MaximumKilobytes configuration (@Coriolanuss)
* #3039 Added Xamarin PreserveAttribute for the entire Assembly to improve AOT-linking (@snakefoot)
* #3045 Create snupkg packages and use portable PDB (@snakefoot)
* #3048 KeepFileOpen + ConcurrentWrites on Xamarin + UWP - #3079 (@304NotModified)
* #3082 + #3100  WebService Target allow custom override of SoapAction-header for Soap11 (@AlexeyRokhin)
* Various refactorings (15 pull requests) (@beppemarazzi, @304NotModified, @snakefoot)

### Performance

* #2650 AsyncTargetWrapper using ConcurrentQueue for NetCore2 for better thread-concurrency (@snakefoot)
* #2890 AsyncTargetWrapper - TimeToSleepBetweenBatches changed default to 1ms (@snakefoot)
* #2897 InternalLogger performance optimization when LogLevel.Off (@snakefoot)
* #2935 InternalLogger LogLevel changes to LogLevel.Off by default unless being used. (@snakefoot)
* #2934 CsvLayout - Allocation optimizations and optional skip quoting-check for individual columns. (@snakefoot)
* #2949 MappedDiagnosticsLogicalContext - SetScoped with IReadOnlyList (Prepare for MEL BeginScope) (@snakefoot)
* #2973 IRenderString-interface to improve performance for Layout with single LayoutRenderer (@snakefoot)
* #3103 StringBuilderPool - Reduce memory overhead until required (@snakefoot)

**LibLog Breaking change**

* [damianh/LibLog#181](https://github.com/damianh/LibLog/pull/181) - Sub-components using LibLog ver. 5.0.3 (or newer) will now use MDLC + NDLC (Instead of MDC + NDC) when detecting application is using NLog ver. 4.6. Make sure to update NLog.config to match this change. Make sure that all sub-components have upgraded to LibLog ver. 5.0.3 (or newer) if they make use of `OpenNestedContext` or `OpenMappedContext`.

See also [NLog 4.6 Milestone](https://github.com/NLog/NLog/milestone/44?closed=1)

Full changelog: https://github.com/NLog/NLog/blob/master/CHANGELOG.md

Supported can be found on https://nlog-project.org/config/

Version History

Version Downloads Last updated
4.6.0 7,273 3/21/2019
4.6.0-rc3 622 3/15/2019
4.6.0-rc2 989 3/10/2019
4.6.0-rc1 6,105 2/8/2019
4.5.11 1,001,218 11/6/2018
4.5.10 1,017,496 9/17/2018
4.5.9 351,524 8/24/2018
4.5.8 545,980 8/5/2018
4.5.7 277,315 7/19/2018
4.5.6 808,774 5/29/2018
4.5.5 183,284 5/25/2018
4.5.4 635,789 5/5/2018
4.5.3 366,935 4/16/2018
4.5.2 340,508 4/6/2018
4.5.1 78,907 4/3/2018
4.5.0 578,002 3/25/2018
4.4.13 273,034 2/27/2018
4.4.12 2,199,255 8/8/2017
4.4.11 660,315 6/17/2017
4.4.10 196,412 5/31/2017
4.4.9 435,875 5/5/2017
4.4.8 70,857 4/28/2017
4.4.7 52,772 4/25/2017
4.4.6 138,815 4/15/2017
4.4.5 218,998 3/28/2017
4.4.4 222,974 3/10/2017
4.4.3 332,173 2/17/2017
4.4.2 181,742 2/6/2017
4.4.1 504,749 12/24/2016
4.4.0 155,297 12/14/2016
4.3.11 503,874 11/7/2016
4.3.10 331,970 10/11/2016
4.3.9 272,492 9/18/2016
4.3.8 325,005 9/5/2016
4.3.7 321,719 8/6/2016
4.3.6 157,737 7/23/2016
4.3.5 474,532 6/12/2016
4.3.4 376,397 5/16/2016
4.3.3 159,346 4/28/2016
4.3.2 47,751 4/26/2016
4.3.1 64,575 4/20/2016
4.3.0 46,249 4/16/2016
4.2.3 776,884 12/20/2015
4.2.2 139,049 12/2/2015
4.2.1 93,114 11/21/2015
4.2.0 208,037 10/24/2015
4.1.2 381,899 9/20/2015
4.1.1 61,061 9/12/2015
4.1.0 105,570 8/31/2015
4.0.1 417,030 6/18/2015
4.0.0 282,196 6/9/2015
3.2.1 361,277 4/24/2015
3.2.0 745,076 1/2/2015
3.1.0 782,971 6/24/2014
3.0.0 120,457 6/2/2014
2.1.0 668,592 10/10/2013
2.0.1.2 413,545 4/8/2013
2.0.0.2000 641,226 7/18/2011
1.0.0.505 106,901 1/7/2011
Show less