Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.6.4 #3437

Merged
merged 23 commits into from
May 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0b7edd9
EnvironmentUserLayoutRenderer - UserName on NetCore
snakefoot May 12, 2019
7ebf345
Log4JXmlEventLayout - Added support for configuration of Parameters
snakefoot May 12, 2019
eb76112
Updated description
304NotModified May 12, 2019
fdb53b7
added defaultAction to XSD
304NotModified May 12, 2019
fc7cc7d
Update package descriptions
304NotModified May 12, 2019
2b17e0e
${when}, support for RawValue on Inner and Else (#3373)
304NotModified May 6, 2019
c1528db
${whenEmpty} implemented IRawValue and IStringValueRenderer (#3398)
snakefoot May 14, 2019
ef259aa
LoggingConfigurationParser - Recognize LoggingRule.RuleName property
snakefoot May 21, 2019
37778fd
ConcurrentRequestQueue - Fixed deadlock caused by misunderstanding Mo…
snakefoot May 22, 2019
f4479a1
XSD: Add RuleName attribute for <logger>
304NotModified May 20, 2019
dfa6adf
XSD: Updated documentation for name filter attribute on <logger>
304NotModified May 20, 2019
ac99f26
XSD: added warning in documentation for throwExceptions - not recomme…
304NotModified May 20, 2019
99453ee
ConcurrentRequestQueue - Improved DequeueBatch performance when block…
snakefoot May 22, 2019
04cb3a0
${all-event-properties}: Added IncludeEmptyValues option
304NotModified May 24, 2019
458feb4
Serialization: improved support for custom expando objects
snakefoot May 24, 2019
267d29e
BufferingTargetWrapper - Avoid Timer starvation when SlidingTimeout =…
snakefoot May 24, 2019
e03f064
Build projects in parallel
304NotModified May 24, 2019
23ddbb4
only nuget.exe when missing
304NotModified May 24, 2019
27fb515
ObjectReflectionCache - Skip property-reflection for IFormattable
snakefoot May 25, 2019
705c39c
ConcurrentRequestQueue - Always see queue as empty after having reach…
snakefoot May 26, 2019
130fceb
Added "Properties" property on Logger for reading and editing propert…
snakefoot May 28, 2019
7e055c3
changelog
304NotModified May 20, 2019
afb2de1
version
304NotModified May 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,35 @@ Date format: (year/month/day)

## Change Log

### V4.6.4 (2019/05/28)

#### Bugfixes

- [#3392](https://github.com/NLog/NLog/pull/3392) NLog.Schema: Added missing defaultAction attribute on filters element in XSD (@304NotModified)
- [#3415](https://github.com/NLog/NLog/pull/3415) AsyncWrapper in Blocking Mode can cause deadlock (@snakefoot)

#### Features

- [#3430](https://github.com/NLog/NLog/pull/3430) Added "Properties" property on Logger for reading and editing properties.(@snakefoot, @304NotModified)
- [#3423](https://github.com/NLog/NLog/pull/3423) ${all-event-properties}: Added IncludeEmptyValues option (@304NotModified)
- [#3394](https://github.com/NLog/NLog/pull/3394) ${when}, support for non-string values (@304NotModified)
- [#3398](https://github.com/NLog/NLog/pull/3398) ${whenEmpty} support for non-string values (@snakefoot, @304NotModified)
- [#3391](https://github.com/NLog/NLog/pull/3391) Added ${environment-user} (@snakefoot)
- [#3389](https://github.com/NLog/NLog/pull/3389) Log4JXmlEventLayout - Added support for configuration of Parameters (@snakefoot)
- [#3411](https://github.com/NLog/NLog/pull/3411) LoggingConfigurationParser - Recognize LoggingRule.RuleName property (@snakefoot)

#### Improvements

- [#3393](https://github.com/NLog/NLog/pull/3393) Update package descriptions to note the issues with <PackageReference> (@304NotModified)
- [#3409](https://github.com/NLog/NLog/pull/3409) Various XSD improvements (NLog.Schema package) (@304NotModified)

#### Performance

- [#3398](https://github.com/NLog/NLog/pull/3398) ${whenEmpty} faster rendering of string values (@snakefoot, @304NotModified)
- [#3405](https://github.com/NLog/NLog/pull/3405) FilteringTargetWrapper: Add support for batch writing (@snakefoot, @304NotModified)
- [#3405](https://github.com/NLog/NLog/pull/3405) PostFilteringTargetWrapper: performance optimizations (@snakefoot, @304NotModified)
- [#3435](https://github.com/NLog/NLog/pull/3435) Async / buffering wrapper: Improve performance when blocking (@snakefoot)
- [#3434](https://github.com/NLog/NLog/pull/3434) ObjectReflectionCache - Skip property-reflection for IFormattable (@snakefoot)

### V4.6.3 (2019/04/30)

Expand Down
16 changes: 9 additions & 7 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dotnet --version
# dotnet restore .\src\NLog\
# dotnet pack .\src\NLog\ --configuration release --include-symbols -o ..\..\artifacts

$versionPrefix = "4.6.3"
$versionPrefix = "4.6.4"
$versionSuffix = ""
$versionFile = $versionPrefix + "." + ${env:APPVEYOR_BUILD_NUMBER}
$versionProduct = $versionPrefix;
Expand All @@ -18,21 +18,23 @@ if ($env:APPVEYOR_PULL_REQUEST_NUMBER)
$versionSuffix = "PR" + $env:APPVEYOR_PULL_REQUEST_NUMBER
}

# download nuget.exe

$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$targetNugetExe = "tools\nuget.exe"
Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe
if (-Not (test-path $targetNugetExe))
{
# download nuget.exe
$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe
}

msbuild /t:Restore,Pack .\src\NLog\ /p:targetFrameworks='"net45;net40-client;net35;netstandard1.3;netstandard1.5;netstandard2.0;sl4;sl5;wp8;monoandroid44;xamarinios10"' /p:VersionPrefix=$versionPrefix /p:VersionSuffix=$versionSuffix /p:FileVersion=$versionFile /p:ProductVersion=$versionProduct /p:Configuration=Release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:PackageOutputPath=..\..\artifacts /verbosity:minimal
msbuild /t:Restore,Pack .\src\NLog\ /p:targetFrameworks='"net45;net40-client;net35;netstandard1.3;netstandard1.5;netstandard2.0;sl4;sl5;wp8;monoandroid44;xamarinios10"' /p:VersionPrefix=$versionPrefix /p:VersionSuffix=$versionSuffix /p:FileVersion=$versionFile /p:ProductVersion=$versionProduct /p:Configuration=Release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:PackageOutputPath=..\..\artifacts /verbosity:minimal /maxcpucount
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }

function create-package($packageName)
{

$path = ".\src\$packageName\"
msbuild /t:Restore,Pack $path /p:VersionPrefix=$versionPrefix /p:VersionSuffix=$versionSuffix /p:FileVersion=$versionFile /p:ProductVersion=$versionProduct /p:Configuration=Release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:PackageOutputPath=..\..\artifacts /verbosity:minimal
msbuild /t:Restore,Pack $path /p:VersionPrefix=$versionPrefix /p:VersionSuffix=$versionSuffix /p:FileVersion=$versionFile /p:ProductVersion=$versionProduct /p:Configuration=Release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:PackageOutputPath=..\..\artifacts /verbosity:minimal /maxcpucount
if (-Not $LastExitCode -eq 0)
{ exit $LastExitCode }

Expand Down
7 changes: 6 additions & 1 deletion src/NLog/Common/LogEventInfoBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,15 @@ public LogEventInfoBuffer(int size, bool growAsNeeded, int growLimit)
}

/// <summary>
/// Gets the number of items in the array.
/// Gets the capacity of the buffer
/// </summary>
public int Size => _buffer.Length;

/// <summary>
/// Gets the number of items in the buffer
/// </summary>
internal int Count { get { lock (_lockObject) return _count; } }

/// <summary>
/// Adds the specified log event to the buffer.
/// </summary>
Expand Down
7 changes: 2 additions & 5 deletions src/NLog/Config/LoggingConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class LoggingConfiguration
/// <summary>
/// Variables defined in xml or in API. name is case case insensitive.
/// </summary>
private readonly Dictionary<string, SimpleLayout> _variables = new Dictionary<string, SimpleLayout>(StringComparer.OrdinalIgnoreCase);
private readonly ThreadSafeDictionary<string, SimpleLayout> _variables = new ThreadSafeDictionary<string, SimpleLayout>(StringComparer.OrdinalIgnoreCase);

/// <summary>
/// Gets the factory that will be configured
Expand Down Expand Up @@ -812,10 +812,7 @@ private List<ISupportsInitialize> GetSupportsInitializes(bool reverse = false)
/// <param name="masterVariables">Master variables dictionary</param>
internal void CopyVariables(IDictionary<string, SimpleLayout> masterVariables)
{
foreach (var variable in masterVariables)
{
Variables[variable.Key] = variable.Value;
}
_variables.CopyFrom(masterVariables);
}

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions src/NLog/Config/LoggingConfigurationParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,9 @@ private LoggingRule ParseRuleElement(ILoggingConfigurationElement loggerElement)
else
ruleName = childProperty.Value;
break;
case "RULENAME":
ruleName = childProperty.Value; // Legacy Style
break;
case "LOGGER":
namePattern = childProperty.Value;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/NLog/Config/LoggingRule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public ReadOnlyCollection<LogLevel> Levels
}

/// <summary>
/// Default action if all filters won't match
/// Default action if none of the filters match
/// </summary>
public FilterResult DefaultFilterResult { get; set; } = FilterResult.Neutral;

Expand Down
9 changes: 5 additions & 4 deletions src/NLog/GlobalDiagnosticsContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ namespace NLog
/// </summary>
public static class GlobalDiagnosticsContext
{
private static readonly object _lockObject = new object();
private static Dictionary<string, object> _dict = new Dictionary<string, object>();
private static Dictionary<string, object> _dictReadOnly; // Reset cache on change

Expand All @@ -63,7 +64,7 @@ public static void Set(string item, string value)
/// <param name="value">Item value.</param>
public static void Set(string item, object value)
{
lock (_dict)
lock (_lockObject)
{
bool requireCopyOnWrite = _dictReadOnly != null && !_dict.ContainsKey(item); // Overwiting existing value is ok (no resize)
GetWritableDict(requireCopyOnWrite)[item] = value;
Expand Down Expand Up @@ -129,7 +130,7 @@ public static bool Contains(string item)
/// <param name="item">Item name.</param>
public static void Remove(string item)
{
lock (_dict)
lock (_lockObject)
{
bool requireCopyOnWrite = _dictReadOnly != null && _dict.ContainsKey(item);
GetWritableDict(requireCopyOnWrite).Remove(item);
Expand All @@ -141,7 +142,7 @@ public static void Remove(string item)
/// </summary>
public static void Clear()
{
lock (_dict)
lock (_lockObject)
{
bool requireCopyOnWrite = _dictReadOnly != null && _dict.Count > 0;
GetWritableDict(requireCopyOnWrite, true).Clear();
Expand All @@ -153,7 +154,7 @@ public static void Clear()
var readOnly = _dictReadOnly;
if (readOnly == null)
{
lock (_dict)
lock (_lockObject)
{
readOnly = _dictReadOnly = _dict;
}
Expand Down