Skip to content

Commit

Permalink
Merge pull request #1271 from serilog/dev
Browse files Browse the repository at this point in the history
2.8.0 Release
  • Loading branch information
nblumhardt committed Jan 16, 2019
2 parents 12ca059 + f197269 commit 870feca
Show file tree
Hide file tree
Showing 45 changed files with 1,111 additions and 90 deletions.
30 changes: 30 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
2.7.1
* #1075 - overload of `LoggerSinkConfiguration.Wrap()` accepting `LoggingLevelSwitch`
* #1083 - update package metadata, including `https://` project and icon URLs
* #1091 - make `{Properties:j}` work consistently with the console sink
* #1110 - expose an efficient `Logger.None`
* #1113 - (tooling) improve tests for `LogContext`
* #1136 - (tooling) fix `build.sh` exit code
* #1141 - fix logging of `byte[]` smaller than 1 KB
* #1157 - (tooling) update _.gitignore_
* #1158 - (tooling) re-enable macOS builds
* #1163 - SourceLink v2 support
* #1165 - fix a number of issues with `LoggerSinkConfiguration.Wrap()` affecting `WriteTo.Async()`
* #1134 - (tooling) add README badges for downloads/stats
* #1166 - allow `LoggerConfiguration` to be garbage collected after logger is created
* #1160 - (tooling) update NuGet.org API key
* (tooling) Update to use the latest .NET SDK

2.6.0
* #992 - fix `LogContext` remoting issue on .NET Framework 4.5
* #1007 - `LogContext.Suspend()` and `LogContext.Reset()` to pass or drop context from child tasks
* #1018 - include source in NUPKGs
* #1020 - support for `LoggingLevelSwitch` in key-value/`<appSettings>` settings
* #1033 - warn when `MinimumLevel.Override()` is used in a sub-logger
* #1034 - more efficient levelled `ILogger.ForContext()`/`Log.ForContext()`
* #1051 - handle duplicate keys in key-value/`<appSettings>` settings (last-in wins)
* #1064 - support static member references as key-value/`<appSettings>` values
* #1059 - support for abstract class parameters in settings
* #1068 - handle parsing of token width more robustly
* Plus build/documentation items #988, #994, #996, #1019, #842, #1042, #1050, #1055, #1063.

2.5.0
* #939, #946, #972 - RTM .NET Standard/Core tooling
* #955 - `LoggerSinkConfiguration.Wrap()`
Expand Down
3 changes: 1 addition & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ for path in test/*.Tests/*.csproj; do
done

for path in test/*.PerformanceTests/*.PerformanceTests.csproj; do
dotnet build -f netcoreapp1.1 -c Release ${path}
# dotnet test -f netcoreapp1.1 -c Release ${path}
dotnet build -f netcoreapp2.0 -c Release ${path}
done
19 changes: 19 additions & 0 deletions results/netcoreapp2.0/AllocationsBenchmark-report-github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
``` ini

BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12
Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4
Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN
dotnet cli version=2.1.4
[Host] : .NET Core 4.6.0.0, 64bit RyuJIT
DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT


```
| Method | Mean | Error | StdDev | Median | Scaled | ScaledSD | Gen 0 | Allocated |
|--------------------- |--------------:|------------:|--------------:|--------------:|---------:|---------:|-------:|----------:|
| LogEmpty | 8.295 ns | 0.1916 ns | 0.1882 ns | 8.251 ns | 1.00 | 0.00 | - | 0 B |
| LogEmptyWithEnricher | 129.205 ns | 4.7752 ns | 13.5464 ns | 126.329 ns | 15.58 | 1.66 | 0.0265 | 56 B |
| LogScalar | 998.006 ns | 19.7947 ns | 48.5568 ns | 993.968 ns | 120.37 | 6.37 | 0.2060 | 432 B |
| LogDictionary | 6,418.543 ns | 142.5459 ns | 418.0626 ns | 6,304.087 ns | 774.13 | 52.90 | 1.0910 | 2296 B |
| LogSequence | 2,664.592 ns | 52.9768 ns | 145.9136 ns | 2,655.944 ns | 321.37 | 18.83 | 0.4158 | 880 B |
| LogAnonymous | 12,776.209 ns | 378.7175 ns | 1,110.7127 ns | 12,563.375 ns | 1,540.91 | 137.42 | 1.6785 | 3528 B |
17 changes: 17 additions & 0 deletions results/netcoreapp2.0/LevelControlBenchmark-report-github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
``` ini

BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12
Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4
Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN
dotnet cli version=2.1.4
[Host] : .NET Core 4.6.0.0, 64bit RyuJIT
DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT


```
| Method | Mean | Error | StdDev | Scaled | ScaledSD |
|--------------- |----------:|----------:|----------:|-------:|---------:|
| Off | 2.931 ns | 0.0893 ns | 0.0877 ns | 1.00 | 0.00 |
| LevelSwitchOff | 3.636 ns | 0.1048 ns | 0.1029 ns | 1.24 | 0.05 |
| MinimumLevelOn | 10.497 ns | 0.2462 ns | 0.3370 ns | 3.58 | 0.15 |
| LevelSwitchOn | 10.981 ns | 0.3005 ns | 0.3340 ns | 3.75 | 0.15 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
``` ini

BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12
Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4
Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN
dotnet cli version=2.1.4
[Host] : .NET Core 4.6.0.0, 64bit RyuJIT
DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT


```
| Method | Mean | Error | StdDev | Scaled | ScaledSD |
|--------------------- |----------:|----------:|-----------:|-------:|---------:|
| Bare | 12.05 ns | 0.3210 ns | 0.5789 ns | 1.00 | 0.00 |
| PushProperty | 149.67 ns | 2.9527 ns | 3.2820 ns | 12.45 | 0.62 |
| PushPropertyNested | 296.44 ns | 6.7011 ns | 11.0101 ns | 24.65 | 1.43 |
| PushPropertyEnriched | 304.18 ns | 5.7287 ns | 8.3971 ns | 25.29 | 1.33 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
``` ini

BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12
Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4
Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN
dotnet cli version=2.1.4
[Host] : .NET Core 4.6.0.0, 64bit RyuJIT
DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT


```
| Method | Items | MaxDegreeOfParallelism | Mean | Error | StdDev | Median | Scaled | ScaledSD |
|----------- |------ |----------------------- |------------:|-----------:|------------:|------------:|-------:|---------:|
| **Dictionary** | **10** | **-1** | **484.65 us** | **29.5203 us** | **86.1121 us** | **475.13 us** | **1.00** | **0.00** |
| Hashtable | 10 | -1 | 74.78 us | 1.5697 us | 2.8304 us | 73.99 us | 0.16 | 0.03 |
| Concurrent | 10 | -1 | 69.52 us | 0.6831 us | 0.5704 us | 69.62 us | 0.15 | 0.03 |
| **Dictionary** | **10** | **1** | **116.22 us** | **2.2490 us** | **2.4998 us** | **115.86 us** | **1.00** | **0.00** |
| Hashtable | 10 | 1 | 140.77 us | 2.8065 us | 4.1137 us | 140.40 us | 1.21 | 0.04 |
| Concurrent | 10 | 1 | 132.99 us | 2.2509 us | 1.9954 us | 132.61 us | 1.14 | 0.03 |
| **Dictionary** | **20** | **-1** | **593.71 us** | **30.5094 us** | **89.9578 us** | **602.83 us** | **1.00** | **0.00** |
| Hashtable | 20 | -1 | 136.36 us | 3.6865 us | 10.5773 us | 133.11 us | 0.24 | 0.04 |
| Concurrent | 20 | -1 | 127.68 us | 2.7541 us | 5.1729 us | 125.60 us | 0.22 | 0.03 |
| **Dictionary** | **20** | **1** | **247.53 us** | **4.9128 us** | **8.8589 us** | **247.69 us** | **1.00** | **0.00** |
| Hashtable | 20 | 1 | 269.34 us | 5.0332 us | 4.7081 us | 270.26 us | 1.09 | 0.04 |
| Concurrent | 20 | 1 | 265.41 us | 5.0592 us | 4.2247 us | 264.26 us | 1.07 | 0.04 |
| **Dictionary** | **50** | **-1** | **1,344.03 us** | **75.5937 us** | **219.3111 us** | **1,299.64 us** | **1.00** | **0.00** |
| Hashtable | 50 | -1 | 319.29 us | 6.2183 us | 10.7263 us | 316.55 us | 0.24 | 0.04 |
| Concurrent | 50 | -1 | 311.74 us | 6.3992 us | 16.7456 us | 305.20 us | 0.24 | 0.04 |
| **Dictionary** | **50** | **1** | **580.35 us** | **10.5809 us** | **9.3797 us** | **580.59 us** | **1.00** | **0.00** |
| Hashtable | 50 | 1 | 685.28 us | 16.2339 us | 23.2821 us | 682.71 us | 1.18 | 0.04 |
| Concurrent | 50 | 1 | 663.75 us | 14.2723 us | 16.9902 us | 664.83 us | 1.14 | 0.03 |
| **Dictionary** | **100** | **-1** | **2,766.91 us** | **70.1788 us** | **206.9237 us** | **2,776.40 us** | **1.00** | **0.00** |
| Hashtable | 100 | -1 | 634.39 us | 11.9496 us | 17.8855 us | 632.35 us | 0.23 | 0.02 |
| Concurrent | 100 | -1 | 607.86 us | 12.1245 us | 14.8900 us | 605.14 us | 0.22 | 0.02 |
| **Dictionary** | **100** | **1** | **1,145.86 us** | **21.7679 us** | **19.2966 us** | **1,151.96 us** | **1.00** | **0.00** |
| Hashtable | 100 | 1 | 1,384.02 us | 26.6146 us | 27.3312 us | 1,386.84 us | 1.21 | 0.03 |
| Concurrent | 100 | 1 | 1,374.88 us | 30.0217 us | 59.2599 us | 1,363.38 us | 1.20 | 0.05 |
| **Dictionary** | **1000** | **-1** | **2,722.48 us** | **70.6602 us** | **206.1192 us** | **2,724.74 us** | **1.00** | **0.00** |
| Hashtable | 1000 | -1 | 634.43 us | 12.5225 us | 19.4960 us | 642.28 us | 0.23 | 0.02 |
| Concurrent | 1000 | -1 | 611.38 us | 11.9573 us | 22.1637 us | 609.39 us | 0.23 | 0.02 |
| **Dictionary** | **1000** | **1** | **1,202.34 us** | **27.6262 us** | **32.8871 us** | **1,196.17 us** | **1.00** | **0.00** |
| Hashtable | 1000 | 1 | 1,408.56 us | 24.4617 us | 22.8815 us | 1,410.87 us | 1.17 | 0.04 |
| Concurrent | 1000 | 1 | 1,342.42 us | 19.1854 us | 17.9460 us | 1,338.93 us | 1.12 | 0.03 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
``` ini

BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12
Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4
Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN
dotnet cli version=2.1.4
[Host] : .NET Core 4.6.0.0, 64bit RyuJIT
DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT


```
| Method | Items | OverflowCount | MaxDegreeOfParallelism | Mean | Error | StdDev | Median | Scaled | ScaledSD |
|----------- |------ |-------------- |----------------------- |-----------:|-----------:|-----------:|-----------:|-------:|---------:|
| **Dictionary** | **10000** | **1** | **-1** | **3.809 ms** | **0.1689 ms** | **0.4900 ms** | **3.695 ms** | **1.00** | **0.00** |
| Hashtable | 10000 | 1 | -1 | 3.401 ms | 0.0587 ms | 0.0763 ms | 3.386 ms | 0.91 | 0.11 |
| Concurrent | 10000 | 1 | -1 | 141.271 ms | 14.7981 ms | 43.6325 ms | 141.945 ms | 37.67 | 12.51 |
| **Dictionary** | **10000** | **1** | **1** | **1.995 ms** | **0.0396 ms** | **0.0617 ms** | **1.982 ms** | **1.00** | **0.00** |
| Hashtable | 10000 | 1 | 1 | 2.581 ms | 0.0429 ms | 0.0401 ms | 2.575 ms | 1.30 | 0.04 |
| Concurrent | 10000 | 1 | 1 | 193.445 ms | 2.1087 ms | 1.9725 ms | 193.561 ms | 97.07 | 3.08 |
| **Dictionary** | **10000** | **10** | **-1** | **3.300 ms** | **0.0726 ms** | **0.2119 ms** | **3.281 ms** | **1.00** | **0.00** |
| Hashtable | 10000 | 10 | -1 | 3.252 ms | 0.0646 ms | 0.1498 ms | 3.232 ms | 0.99 | 0.08 |
| Concurrent | 10000 | 10 | -1 | 81.583 ms | 3.0187 ms | 8.9007 ms | 79.069 ms | 24.82 | 3.12 |
| **Dictionary** | **10000** | **10** | **1** | **1.979 ms** | **0.0390 ms** | **0.0449 ms** | **1.970 ms** | **1.00** | **0.00** |
| Hashtable | 10000 | 10 | 1 | 2.576 ms | 0.0398 ms | 0.0352 ms | 2.563 ms | 1.30 | 0.03 |
| Concurrent | 10000 | 10 | 1 | 200.065 ms | 4.9247 ms | 5.8626 ms | 200.199 ms | 101.16 | 3.64 |
| **Dictionary** | **10000** | **100** | **-1** | **4.076 ms** | **0.0813 ms** | **0.2292 ms** | **4.066 ms** | **1.00** | **0.00** |
| Hashtable | 10000 | 100 | -1 | 3.660 ms | 0.0719 ms | 0.1008 ms | 3.653 ms | 0.90 | 0.06 |
| Concurrent | 10000 | 100 | -1 | 167.547 ms | 20.0876 ms | 58.2777 ms | 175.712 ms | 41.23 | 14.48 |
| **Dictionary** | **10000** | **100** | **1** | **2.061 ms** | **0.0354 ms** | **0.0331 ms** | **2.054 ms** | **1.00** | **0.00** |
| Hashtable | 10000 | 100 | 1 | 2.685 ms | 0.0331 ms | 0.0310 ms | 2.685 ms | 1.30 | 0.02 |
| Concurrent | 10000 | 100 | 1 | 198.448 ms | 2.5433 ms | 2.3790 ms | 198.288 ms | 96.31 | 1.86 |
| **Dictionary** | **10000** | **1000** | **-1** | **3.923 ms** | **0.1650 ms** | **0.4788 ms** | **3.865 ms** | **1.00** | **0.00** |
| Hashtable | 10000 | 1000 | -1 | 3.870 ms | 0.0766 ms | 0.1907 ms | 3.862 ms | 1.00 | 0.13 |
| Concurrent | 10000 | 1000 | -1 | 207.440 ms | 23.7700 ms | 70.0864 ms | 182.505 ms | 53.66 | 19.30 |
| **Dictionary** | **10000** | **1000** | **1** | **2.150 ms** | **0.0278 ms** | **0.0246 ms** | **2.154 ms** | **1.00** | **0.00** |
| Hashtable | 10000 | 1000 | 1 | 2.806 ms | 0.0398 ms | 0.0373 ms | 2.795 ms | 1.31 | 0.02 |
| Concurrent | 10000 | 1000 | 1 | 201.843 ms | 3.2293 ms | 2.8627 ms | 201.881 ms | 93.91 | 1.66 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
``` ini

BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12
Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4
Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN
dotnet cli version=2.1.4
[Host] : .NET Core 4.6.0.0, 64bit RyuJIT
DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT


```
| Method | Mean | Error | StdDev | Scaled | ScaledSD | Gen 0 | Allocated |
|----------------------------- |-----------:|----------:|----------:|-------:|---------:|-------:|----------:|
| EmptyTemplate | 371.0 ns | 7.570 ns | 14.03 ns | 1.00 | 0.00 | 0.1259 | 264 B |
| DefaultConsoleOutputTemplate | 2,912.1 ns | 66.661 ns | 190.19 ns | 7.86 | 0.58 | 1.0948 | 2296 B |
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
``` ini

BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12
Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4
Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN
dotnet cli version=2.1.4
[Host] : .NET Core 4.6.0.0, 64bit RyuJIT
DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT


```
| Method | Mean | Error | StdDev | Gen 0 | Allocated |
|----------------------------- |-----------:|----------:|-----------:|-------:|----------:|
| TemplateWithNoProperties | 5.067 ns | 0.1194 ns | 0.1058 ns | - | 0 B |
| TemplateWithVariedProperties | 423.457 ns | 8.8139 ns | 12.3559 ns | 0.0453 | 96 B |
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
``` ini

BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12
Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4
Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN
dotnet cli version=2.1.4
[Host] : .NET Core 4.6.0.0, 64bit RyuJIT
DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT


```
| Method | Mean | Error | StdDev |
|----------------- |---------:|---------:|---------:|
| ForContextString | 104.5 ns | 2.126 ns | 4.884 ns |
| ForContextType | 173.8 ns | 3.425 ns | 5.021 ns |
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
``` ini

BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12
Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4
Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN
dotnet cli version=2.1.4
[Host] : .NET Core 4.6.0.0, 64bit RyuJIT
DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT


```
| Method | Mean | Error | StdDev | Scaled | ScaledSD |
|------------- |---------:|----------:|----------:|-------:|---------:|
| RootLogger | 11.78 ns | 0.1157 ns | 0.1082 ns | 1.00 | 0.00 |
| NestedLogger | 41.70 ns | 0.1993 ns | 0.1556 ns | 3.54 | 0.03 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
``` ini

BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12
Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4
Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN
dotnet cli version=2.1.4
[Host] : .NET Core 4.6.0.0, 64bit RyuJIT
DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT


```
| Method | Mean | Error | StdDev | Gen 0 | Allocated |
|--------------- |---------:|----------:|----------:|-------:|----------:|
| FormatToOutput | 1.386 us | 0.0237 us | 0.0222 us | 0.2327 | 488 B |
14 changes: 14 additions & 0 deletions results/netcoreapp2.0/PipelineBenchmark-report-github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
``` ini

BenchmarkDotNet=v0.10.6, OS=Mac OS X 10.12
Processor=Intel Core i7-7567U CPU 3.50GHz (Kaby Lake), ProcessorCount=4
Frequency=1000000000 Hz, Resolution=1.0000 ns, Timer=UNKNOWN
dotnet cli version=2.1.4
[Host] : .NET Core 4.6.0.0, 64bit RyuJIT
DefaultJob : .NET Core 4.6.0.0, 64bit RyuJIT


```
| Method | Mean | Error | StdDev | Gen 0 | Allocated |
|------------- |---------:|---------:|---------:|-------:|----------:|
| EmitLogEvent | 837.9 ns | 16.17 ns | 15.88 ns | 0.2060 | 432 B |
2 changes: 1 addition & 1 deletion run_perf_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
dotnet restore

for path in test/*.PerformanceTests/*.csproj; do
dotnet test -f netcoreapp1.1 -c Release ${path}
dotnet test -f netcoreapp2.0 -c Release ${path}
done
10 changes: 8 additions & 2 deletions src/Serilog/Capturing/GetablePropertyFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@ internal static IEnumerable<PropertyInfo> GetPropertiesRecursive(this Type type)
yield return propertyInfo;
}

currentTypeInfo = currentTypeInfo.BaseType.GetTypeInfo();
var baseType = currentTypeInfo.BaseType;
if(baseType == null)
{
yield break;
}

currentTypeInfo = baseType.GetTypeInfo();
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/Serilog/Core/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,6 @@ public void Dispose()
/// <summary>
/// An <see cref="ILogger"/> instance that efficiently ignores all method calls.
/// </summary>
public static ILogger None { get; } = new SilentLogger();
public static ILogger None { get; } = SilentLogger.Instance;
}
}
6 changes: 6 additions & 0 deletions src/Serilog/Core/Pipeline/SilentLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ namespace Serilog.Core.Pipeline
{
class SilentLogger : ILogger
{
public static readonly ILogger Instance = new SilentLogger();

private SilentLogger()
{
}

public ILogger ForContext(ILogEventEnricher enricher)
{
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void Format(LogEvent logEvent, TextWriter output)
}
else
{
propertyValue.Render(output, pt.Format, _formatProvider);
propertyValue.Render(writer, pt.Format, _formatProvider);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Serilog/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace Serilog
/// </remarks>
public static class Log
{
static ILogger _logger = new SilentLogger();
static ILogger _logger = SilentLogger.Instance;

/// <summary>
/// The globally-shared logger.
Expand All @@ -61,7 +61,7 @@ public static ILogger Logger
/// </summary>
public static void CloseAndFlush()
{
ILogger logger = Interlocked.Exchange(ref _logger, new SilentLogger());
ILogger logger = Interlocked.Exchange(ref _logger, SilentLogger.Instance);

(logger as IDisposable)?.Dispose();
}
Expand Down

0 comments on commit 870feca

Please sign in to comment.