Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Threading;
using Microsoft.Extensions.Logging;
using Serilog.Core;
using Serilog.Events;
using FrameworkLogger = Microsoft.Extensions.Logging.ILogger;
using System.Collections.Generic;
using System.Threading;
using Serilog.Context;

namespace Serilog.Extensions.Logging
{
/// <summary>
/// An <see cref="ILoggerProvider"/> that pipes events through Serilog.
/// </summary>
#if LOGGING_BUILDER
[ProviderAlias("Serilog")]
#endif
public class SerilogLoggerProvider : ILoggerProvider, ILogEventEnricher
{
internal const string OriginalFormatPropertyName = "{OriginalFormat}";
Expand Down Expand Up @@ -92,14 +90,8 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)

internal SerilogLoggerScope CurrentScope
{
get
{
return _value.Value;
}
set
{
_value.Value = value;
}
get => _value.Value;
set => _value.Value = value;
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,4 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<DefineConstants>$(DefineConstants);ASYNCLOCAL;LOGGING_BUILDER</DefineConstants>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#if LOGGING_BUILDER

using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -54,5 +52,3 @@ public static ILoggingBuilder AddSerilog(this ILoggingBuilder builder, ILogger l
}
}
}

#endif // LOGGING_BUILDER