From e658217fd39c2f8964474a9df5e32e2a48bfbb7c Mon Sep 17 00:00:00 2001 From: Jan Trejbal Date: Wed, 17 Mar 2021 13:24:02 +0100 Subject: [PATCH 1/5] Drop Microsoft.AspNetCore.Http.Abstractions for netcoreapp3.1 and higher --- .../Serilog.AspNetCore.csproj | 21 +++++++++++++++++-- .../SerilogWebHostBuilderExtensions.cs | 6 +++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj index 63d5ea8..1c8a9be 100644 --- a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj +++ b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj @@ -4,7 +4,7 @@ Serilog support for ASP.NET Core logging 4.0.1 Microsoft;Serilog Contributors - netstandard2.0;netstandard2.1 + netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0 true true ../../assets/Serilog.snk @@ -32,9 +32,26 @@ - + + + + + + + + + + + + + + + + + + diff --git a/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs b/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs index f27a8fb..a063e50 100644 --- a/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs +++ b/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs @@ -13,11 +13,11 @@ // limitations under the License. using System; +using Microsoft.Extensions.DependencyInjection; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Logging; -using Serilog.Extensions.Logging; -using Microsoft.Extensions.DependencyInjection; using Serilog.Extensions.Hosting; +using Serilog.Extensions.Logging; namespace Serilog { @@ -77,7 +77,7 @@ public static IWebHostBuilder UseSerilog( /// The logger will be shut down when application services are disposed. /// /// The web host builder to configure. - /// The delegate for configuring the that will be used to construct a . + /// The delegate for configuring the that will be used to construct a . /// Indicates whether to preserve the value of . /// By default, Serilog does not write events to s registered through /// the Microsoft.Extensions.Logging API. Normally, equivalent Serilog sinks are used in place of providers. Specify From d0667509ccf6bf7dd0af105c846f0ad03dfa0e6e Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Thu, 18 Mar 2021 08:40:24 +1000 Subject: [PATCH 2/5] I think this comment is correct --- src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs b/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs index a063e50..c116f55 100644 --- a/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs +++ b/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs @@ -77,7 +77,7 @@ public static IWebHostBuilder UseSerilog( /// The logger will be shut down when application services are disposed. /// /// The web host builder to configure. - /// The delegate for configuring the that will be used to construct a . + /// The delegate for configuring the that will be used to construct a . /// Indicates whether to preserve the value of . /// By default, Serilog does not write events to s registered through /// the Microsoft.Extensions.Logging API. Normally, equivalent Serilog sinks are used in place of providers. Specify From 1772baefc5dad8cf3d0d5558246f5b9dcba420b4 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Thu, 18 Mar 2021 08:50:26 +1000 Subject: [PATCH 3/5] Add missing `using` statement --- src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs b/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs index c116f55..bfbdba7 100644 --- a/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs +++ b/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs @@ -1,4 +1,4 @@ -// Copyright 2017-2019 Serilog Contributors +// Copyright 2017-2019 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Logging; +using Serilog.Core; using Serilog.Extensions.Hosting; using Serilog.Extensions.Logging; From d9add52ef6c97a92ede1aeb86ae66a1376ab0dc4 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Thu, 18 Mar 2021 08:55:37 +1000 Subject: [PATCH 4/5] Explicitly qualify Serilog types in crefs --- .../SerilogWebHostBuilderExtensions.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs b/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs index bfbdba7..ffc45b9 100644 --- a/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs +++ b/src/Serilog.AspNetCore/SerilogWebHostBuilderExtensions.cs @@ -16,7 +16,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Logging; -using Serilog.Core; using Serilog.Extensions.Hosting; using Serilog.Extensions.Logging; @@ -33,8 +32,8 @@ public static class SerilogWebHostBuilderExtensions /// The web host builder to configure. /// The Serilog logger; if not supplied, the static will be used. /// When true, dispose when the framework disposes the provider. If the - /// logger is not specified but is true, the method will be - /// called on the static class instead. + /// logger is not specified but is true, the method will be + /// called on the static class instead. /// A registered in the Serilog pipeline using the /// WriteTo.Providers() configuration method, enabling other s to receive events. By /// default, only Serilog sinks will receive events. @@ -78,8 +77,8 @@ public static IWebHostBuilder UseSerilog( /// The logger will be shut down when application services are disposed. /// /// The web host builder to configure. - /// The delegate for configuring the that will be used to construct a . - /// Indicates whether to preserve the value of . + /// The delegate for configuring the that will be used to construct a . + /// Indicates whether to preserve the value of . /// By default, Serilog does not write events to s registered through /// the Microsoft.Extensions.Logging API. Normally, equivalent Serilog sinks are used in place of providers. Specify /// true to write events to all providers. From e7bf041439c4762410349d4e4f914e64b97fdd3f Mon Sep 17 00:00:00 2001 From: Jan Trejbal Date: Thu, 18 Mar 2021 00:05:11 +0100 Subject: [PATCH 5/5] Use different versions of Microsoft.Extensions for targets --- src/Serilog.AspNetCore/Serilog.AspNetCore.csproj | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj index 1c8a9be..de4df27 100644 --- a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj +++ b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj @@ -32,26 +32,32 @@ - - + + + + + + + +