From ffed9d231aefc3de7c13a03a570fb45c326632b0 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 12 Nov 2019 12:44:36 +1000 Subject: [PATCH 01/24] Dev version bump [skip ci] --- src/Serilog.AspNetCore/Serilog.AspNetCore.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj index 5c5c3f7..f8ebe13 100644 --- a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj +++ b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj @@ -2,7 +2,7 @@ Serilog support for ASP.NET Core logging - 3.2.0 + 3.2.1 Microsoft;Serilog Contributors netstandard2.0 true From 71b0f0b43b64f55aaa36fd141a45130b22104531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=B6bstl?= Date: Thu, 23 Jan 2020 14:54:40 +0100 Subject: [PATCH 02/24] Update Instructions for .NET Core 3 templates The instructions for using Serilog contained statements that were no longer valid since .NET Core 3.0 uses the Generic Host and new project templates. The code sample in the readme and the corresponding statements were updated to resemble these changes. --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 860fe95..e14efc0 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ public class Program try { Log.Information("Starting web host"); - CreateWebHostBuilder(args).Build().Run(); + CreateHostBuilder(args).Build().Run(); return 0; } catch (Exception ex) @@ -46,21 +46,22 @@ public class Program } ``` -**Then**, add `UseSerilog()` to the web host builder in `BuildWebHost()`. +**Then**, add `UseSerilog()` to the Generic Host in `CreateHostBuilder()`. ```csharp - public static IWebHostBuilder CreateWebHostBuilder(string[] args) => - WebHost.CreateDefaultBuilder(args) - .UseStartup() + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }) .UseSerilog(); // <-- Add this line; } ``` **Finally**, clean up by removing the remaining configuration for the default logger: - * Remove calls to `AddLogging()` * Remove the `"Logging"` section from _appsettings.json_ files (this can be replaced with [Serilog configuration](https://github.com/serilog/serilog-settings-configuration) as shown in [the _EarlyInitializationSample_ project](https://github.com/serilog/serilog-aspnetcore/blob/dev/samples/EarlyInitializationSample/Program.cs), if required) - * Remove `ILoggerFactory` parameters and any `Add*()` calls on the logger factory in _Startup.cs_ * Remove `UseApplicationInsights()` (this can be replaced with the [Serilog AI sink](https://github.com/serilog/serilog-sinks-applicationinsights), if required) That's it! With the level bumped up a little you will see log output resembling: From de27db1d2583a16dd7b047256e4ac023a4d4bc0b Mon Sep 17 00:00:00 2001 From: TeBeCo Date: Sat, 18 Jan 2020 17:11:09 +0100 Subject: [PATCH 03/24] Cross target to netcoreapp3.1 (LTS) --- global.json | 2 +- .../Serilog.AspNetCore.csproj | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/global.json b/global.json index 2223a05..f1c2b2b 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.0.100" + "version": "3.1.101" } } \ No newline at end of file diff --git a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj index f8ebe13..8d96e06 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 3.2.1 Microsoft;Serilog Contributors - netstandard2.0 + netstandard2.0;netcoreapp3.1 true true ../../assets/Serilog.snk @@ -28,9 +28,18 @@ - - - + + + + + + + + + + + + From f76b6db19460958a4a506b16217608a1d9612c0a Mon Sep 17 00:00:00 2001 From: TeBeCo Date: Sat, 18 Jan 2020 18:01:28 +0100 Subject: [PATCH 04/24] cross target the samples to be sure it ran for both netcoreapp2.1 and 3.1 --- test/Serilog.AspNetCore.Tests/Serilog.AspNetCore.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Serilog.AspNetCore.Tests/Serilog.AspNetCore.Tests.csproj b/test/Serilog.AspNetCore.Tests/Serilog.AspNetCore.Tests.csproj index 83b1006..d6e81ac 100644 --- a/test/Serilog.AspNetCore.Tests/Serilog.AspNetCore.Tests.csproj +++ b/test/Serilog.AspNetCore.Tests/Serilog.AspNetCore.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp2.0 + netcoreapp2.1;netcoreapp3.1 Serilog.AspNetCore.Tests ../../assets/Serilog.snk true From 17ecc78486eb2c4bc10037e72150b14cef40d3e4 Mon Sep 17 00:00:00 2001 From: TeBeCo Date: Sat, 18 Jan 2020 18:01:49 +0100 Subject: [PATCH 05/24] re-target samples from netcoreapp3.0 to 3.1 (LTS) --- .../EarlyInitializationSample/EarlyInitializationSample.csproj | 2 +- .../InlineInitializationSample.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/EarlyInitializationSample/EarlyInitializationSample.csproj b/samples/EarlyInitializationSample/EarlyInitializationSample.csproj index 0b71549..2c67adb 100644 --- a/samples/EarlyInitializationSample/EarlyInitializationSample.csproj +++ b/samples/EarlyInitializationSample/EarlyInitializationSample.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 diff --git a/samples/InlineInitializationSample/InlineInitializationSample.csproj b/samples/InlineInitializationSample/InlineInitializationSample.csproj index 0b71549..2c67adb 100644 --- a/samples/InlineInitializationSample/InlineInitializationSample.csproj +++ b/samples/InlineInitializationSample/InlineInitializationSample.csproj @@ -1,7 +1,7 @@  - netcoreapp3.0 + netcoreapp3.1 From ff288cd20fa6ef01e6276d53f52a6bda29a1e726 Mon Sep 17 00:00:00 2001 From: TeBeCo Date: Sat, 18 Jan 2020 18:02:29 +0100 Subject: [PATCH 06/24] Change base image of app veyor to vs2019 as netcoreapp3.0 requires Vs2019 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index ef82a65..9f9e04e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ version: '{build}' skip_tags: true -image: Visual Studio 2017 +image: Visual Studio 2019 install: - ps: ./Setup.ps1 build_script: From 072ac22faffa87c2bb160c925a4e4c2fae4d6bba Mon Sep 17 00:00:00 2001 From: TeBeCo Date: Wed, 12 Feb 2020 18:11:45 +0100 Subject: [PATCH 07/24] Update serilog transitive --- src/Serilog.AspNetCore/Serilog.AspNetCore.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj index 8d96e06..a3b9f9d 100644 --- a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj +++ b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj @@ -21,13 +21,13 @@ - + - + - + From e712b400479597791317cf702fbe460186b1dad8 Mon Sep 17 00:00:00 2001 From: TeBeCo Date: Sat, 18 Jan 2020 17:12:06 +0100 Subject: [PATCH 08/24] Add PackageIcon as PackageIconUrl in going to be deprecated (see https://docs.microsoft.com/en-us/nuget/reference/msbuild-targets#packageiconurl) --- .../Serilog.AspNetCore.csproj | 6 ++++++ .../images/serilog-extension-nuget.png | Bin 0 -> 22378 bytes 2 files changed, 6 insertions(+) create mode 100644 src/Serilog.AspNetCore/images/serilog-extension-nuget.png diff --git a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj index a3b9f9d..f6aca73 100644 --- a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj +++ b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj @@ -11,6 +11,7 @@ true true serilog;aspnet;aspnetcore + serilog-extension-nuget.png https://serilog.net/images/serilog-extension-nuget.png https://github.com/serilog/serilog-aspnetcore Apache-2.0 @@ -20,6 +21,10 @@ Serilog + + + + @@ -38,6 +43,7 @@ + diff --git a/src/Serilog.AspNetCore/images/serilog-extension-nuget.png b/src/Serilog.AspNetCore/images/serilog-extension-nuget.png new file mode 100644 index 0000000000000000000000000000000000000000..1dfe4308b664e684217d436367a25bf91308f436 GIT binary patch literal 22378 zcmbSzbyQSq*zX`ADcvaDAR!bQ?$r64Kp`G~8#- zckli8u655^XQ|9Ed+#@%=U4AUYCKZF!=}PUAP{&;in3Y=1Pc5W1%ZhHe;BzIS;HS_ zZqiCRnDC!3rd0&|8_QWy-wlCaltBKE67o$;4}M7LE~n?N?PTrlY3}+I;pypl*VfVA z&C=ZY>0Kw+XX)EwR0sqeLP=Ii$LsxOhPRl`)_IS_Jsl#Sd*-1!=qFq#w^Ei-u!b1za{S5&lHiBX!?~)pNADIBk$dK zQqDzJnkzQWjBu0V7{{}7Y!~$oSA+E3mIJ#iM%LX*Dsxi>f z(LF@BcaX0STHH57G_t6b9CVp#X$8m5nps&{!8;qX@epcxo#q2{UXM~VRu(>uJ6u$I za89$Zj-HPF&x@8Rd5n`{Vod!1_VN@6sfiims=TGB5oz*a2fc9=Tk{NYRXdZ-F*qyz zDpn5u|6OcW)Ef8w`wV9O7Z*R0$G*O-lkFx$dycT7Lcg=nZQeVOLqz#NP*8V%TO9fR z<+tH&W@e4a{`B;eh_Xe<237K)r`?Q~*LL6Pu&y?#_oSepK#!az z+G(a)$;#Ip?!S)~E2OP;c~bMu&mnk)aicyO16`M=38tB&UMRU(s3ZZ}u@GZMy5awXvzB`|DlZBI_m z^O_jgb z`}kT~@i5toi)PO?G@3k)_dF` z`84P22HDzBv3qcaD9gxbSHPg+sWFDbjS9q2OdtjZ1T0`2WqwEG{6Am7qoJf^`PrA0 zo!uILsAEG#m-rO*doQo~^KzEM%djxgi0GgBb|)nwKi?Pk9F2F!TnAmgvVM?~%5J`{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0Klzho5jT1g^l)~kr2z0S;>1wQMH6FnxA zSQs$gA&P532af3I);n~F(8HZ-e1vXU?j3c^!O|TD?(^~YPoT;d%ztn*|1?EY#OUkQ@tX7YcJm&GC9mC7xX{L&c3 z+Fn&ObwisMb8G~cLs5`Rvn*NHPiP|a1;Thed^qvPkMLHml8Fg#xL2Gc#9Ghn-?&oa z0zQr?1UaqN$`S(`hzpqqwt}D0qt;W;4{g=fyuXdK{-2S$dg-@s-%>~3K>sG7Xlei1 zR;3U7{yyZH+TA$1Bq$+~2&zcL(9Nq$n%dfUaD>MB&Gj%{J-yx){>;o;E8D)BH^CMb zG+Hx^W@ZAo1 z+Imfo^AZUF;xgVAGFIK8B2KQZGQf2GW$Ac-B9Zcoi@ENG9~p40EV>9YiVN-+``tUUUyfN?y14AA zIjOGgH{jEkY_BY0q><4Cj%!(bV~HaZ*a3&4d;u4ysy>6likY4-i;Kyq74ixxJ6VWQ zBY48D8OLKh@TT{CL;Yv3px4_vpK_31C_IvYaV;1Y#$H&E65xi5=KY7-0Z}wOdYK56 z)bh*_+$NMfLd1sYod6ntZu$CNt8_z+3}abAc(4LER7L5Yy0S74NK^BblAi_1h=|?hUSV3&p;7HcP>bAh)5LnDSx;N%7N4Ptd-Y*&qAww zFVbHeM1ZK)mrN|`#WJvH*1_MqhM_f6{irZuQrf*>%f_9o(4KizQBtCWNWRJ3gq_QY i_~_ijCV{QK6Akww67qFyi&!`pmt Date: Wed, 19 Feb 2020 09:29:50 +0100 Subject: [PATCH 09/24] Remove wildcard, in favor of using explicitly the latest version of nuget being used at build time --- src/Serilog.AspNetCore/Serilog.AspNetCore.csproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj index f6aca73..4a96ad7 100644 --- a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj +++ b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj @@ -36,16 +36,16 @@ - - - + + + - - + + From 5b3f8edef777edb7f215f1452a21dd90e15b188a Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Thu, 20 Feb 2020 07:26:14 +1000 Subject: [PATCH 10/24] Package dependency updates - minor version bump, not binary-breaking [skip ci] --- src/Serilog.AspNetCore/Serilog.AspNetCore.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj index 4a96ad7..62cd77d 100644 --- a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj +++ b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj @@ -2,7 +2,7 @@ Serilog support for ASP.NET Core logging - 3.2.1 + 3.3.0 Microsoft;Serilog Contributors netstandard2.0;netcoreapp3.1 true From 8877e15d68e975c1e650fb7fdad11c494a26172f Mon Sep 17 00:00:00 2001 From: TeBeCo Date: Wed, 19 Feb 2020 23:24:02 +0100 Subject: [PATCH 11/24] Update the global.json so that the SDK match package that are actually used --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index f1c2b2b..995f355 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.1.101" + "version": "3.1.102" } } \ No newline at end of file From b1ae12725ef7c2f6aebb0e0e217272d3e3914113 Mon Sep 17 00:00:00 2001 From: Ralph Hendriks Date: Mon, 24 Feb 2020 09:15:07 +0100 Subject: [PATCH 12/24] Pin .NET Core SDK version to latest feature band Pin the .NET Core SDK version to the `3.1.1xx` feature band. Do not allow prerelease versions. Fixes #175 --- global.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/global.json b/global.json index 995f355..5442449 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,7 @@ { "sdk": { - "version": "3.1.102" + "allowPrerelease": false, + "version": "3.1.100", + "rollForward": "latestPatch" } } \ No newline at end of file From 28d4dd2b99d211222b19a84811ab88c263d96ec3 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Thu, 26 Mar 2020 08:32:18 +1000 Subject: [PATCH 13/24] Spike for #182, allow an ILogger to be specified --- .../AspNetCore/RequestLoggingMiddleware.cs | 5 ++++- .../AspNetCore/RequestLoggingOptions.cs | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Serilog.AspNetCore/AspNetCore/RequestLoggingMiddleware.cs b/src/Serilog.AspNetCore/AspNetCore/RequestLoggingMiddleware.cs index e6c17f1..4472e5d 100644 --- a/src/Serilog.AspNetCore/AspNetCore/RequestLoggingMiddleware.cs +++ b/src/Serilog.AspNetCore/AspNetCore/RequestLoggingMiddleware.cs @@ -24,6 +24,7 @@ namespace Serilog.AspNetCore { + // ReSharper disable once ClassNeverInstantiated.Global class RequestLoggingMiddleware { readonly RequestDelegate _next; @@ -31,6 +32,7 @@ class RequestLoggingMiddleware readonly MessageTemplate _messageTemplate; readonly Action _enrichDiagnosticContext; readonly Func _getLevel; + readonly ILogger _logger; static readonly LogEventProperty[] NoProperties = new LogEventProperty[0]; public RequestLoggingMiddleware(RequestDelegate next, DiagnosticContext diagnosticContext, RequestLoggingOptions options) @@ -42,6 +44,7 @@ public RequestLoggingMiddleware(RequestDelegate next, DiagnosticContext diagnost _getLevel = options.GetLevel; _enrichDiagnosticContext = options.EnrichDiagnosticContext; _messageTemplate = new MessageTemplateParser().Parse(options.MessageTemplate); + _logger = options.Logger?.ForContext(); } // ReSharper disable once UnusedMember.Global @@ -73,7 +76,7 @@ public async Task Invoke(HttpContext httpContext) bool LogCompletion(HttpContext httpContext, DiagnosticContextCollector collector, int statusCode, double elapsedMs, Exception ex) { - var logger = Log.ForContext(); + var logger = _logger ?? Log.ForContext(); var level = _getLevel(httpContext, elapsedMs, ex); if (!logger.IsEnabled(level)) return false; diff --git a/src/Serilog.AspNetCore/AspNetCore/RequestLoggingOptions.cs b/src/Serilog.AspNetCore/AspNetCore/RequestLoggingOptions.cs index 327e468..6a69f55 100644 --- a/src/Serilog.AspNetCore/AspNetCore/RequestLoggingOptions.cs +++ b/src/Serilog.AspNetCore/AspNetCore/RequestLoggingOptions.cs @@ -16,6 +16,8 @@ using Serilog.Events; using System; +// ReSharper disable UnusedAutoPropertyAccessor.Global + namespace Serilog.AspNetCore { /// @@ -50,6 +52,13 @@ public class RequestLoggingOptions /// public Action EnrichDiagnosticContext { get; set; } + + /// + /// The logger through which request completion events will be logged. The default is to use the + /// static class. + /// + public ILogger Logger { get; set; } + internal RequestLoggingOptions() { } } } From 8fd539d711feafbc5133df37b152393627eaedbc Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Date: Thu, 30 Apr 2020 16:11:39 -0300 Subject: [PATCH 14/24] Fallback RequestPath for when IHttpRequestFeature.RawTarteg is empty instead of null --- .../AspNetCore/RequestLoggingMiddleware.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Serilog.AspNetCore/AspNetCore/RequestLoggingMiddleware.cs b/src/Serilog.AspNetCore/AspNetCore/RequestLoggingMiddleware.cs index e6c17f1..db2eb0c 100644 --- a/src/Serilog.AspNetCore/AspNetCore/RequestLoggingMiddleware.cs +++ b/src/Serilog.AspNetCore/AspNetCore/RequestLoggingMiddleware.cs @@ -106,7 +106,13 @@ static double GetElapsedMilliseconds(long start, long stop) static string GetPath(HttpContext httpContext) { - return httpContext.Features.Get()?.RawTarget ?? httpContext.Request.Path.ToString(); + var requestPath = httpContext.Features.Get()?.RawTarget; + if (string.IsNullOrWhiteSpace(requestPath)) + { + requestPath = httpContext.Request.Path.ToString(); + } + + return requestPath; } } } From 4fea46555139083e9f0ec8481c48e9afd14540d0 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Date: Thu, 30 Apr 2020 20:27:50 -0300 Subject: [PATCH 15/24] Using string.IsNullOrEmpty / Adding extra comments --- .../AspNetCore/RequestLoggingMiddleware.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Serilog.AspNetCore/AspNetCore/RequestLoggingMiddleware.cs b/src/Serilog.AspNetCore/AspNetCore/RequestLoggingMiddleware.cs index db2eb0c..08419e5 100644 --- a/src/Serilog.AspNetCore/AspNetCore/RequestLoggingMiddleware.cs +++ b/src/Serilog.AspNetCore/AspNetCore/RequestLoggingMiddleware.cs @@ -106,8 +106,13 @@ static double GetElapsedMilliseconds(long start, long stop) static string GetPath(HttpContext httpContext) { + /* + In some cases, like when running integration tests with WebApplicationFactory + the RawTarget returns an empty string instead of null, in that case we can't use + ?? as fallback. + */ var requestPath = httpContext.Features.Get()?.RawTarget; - if (string.IsNullOrWhiteSpace(requestPath)) + if (string.IsNullOrEmpty(requestPath)) { requestPath = httpContext.Request.Path.ToString(); } From 5386292e6798dc0bd1167d6293f514f2c7577ebd Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Sat, 2 May 2020 07:34:11 +1000 Subject: [PATCH 16/24] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 27 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++++++++ .github/ISSUE_TEMPLATE/usage-help.md | 16 ++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/usage-help.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..04d41db --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,27 @@ +--- +name: Bug report +about: Report a bug and help us to improve Serilog +title: '' +labels: bug +assignees: '' + +--- + +The Serilog maintainers want you to have a great experience using Serilog, and will happily track down and resolve bugs. We all have limited time, though, so please think through all of the factors that might be involved and include as much useful information as possible 😊. + +ℹ If the problem is caused by a sink or other related package, please try to track down the correct repository for that package and create the report there: this tracker is for the **Serilog.AspNetCore** package only. + +**Description** +What's going wrong? + +**Reproduction** +Please provide code samples showing how you're configuring and calling Serilog to produce the behavior. + +**Expected behavior** +A concise description of what you expected to happen. + +**Relevant package, tooling and runtime versions** +What Serilog version are you using, on what platform? + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..272c322 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an improvement to Serilog +title: '' +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/usage-help.md b/.github/ISSUE_TEMPLATE/usage-help.md new file mode 100644 index 0000000..4e4db70 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/usage-help.md @@ -0,0 +1,16 @@ +--- +name: Usage help +about: Get help with using Serilog +title: '' +labels: invalid +assignees: '' + +--- + +Hi! 👋 + +The Serilog community wants you to have a great experience using Serilog. Unfortunately, only a handful of maintainers actively follow this repository, and our time is short, so we cannot answer usage questions posted here. + +Fortunately, a much larger group of people (including some of us) also watch and answer questions on the [`serilog` tag on Stack Overflow](https://stackoverflow.com/questions/tagged/serilog). + +Please head over to Stack Overflow, ask your question, and tag it with `serilog`. Thanks! ❤ From a91dfab01227642ffd427d42aab273332ebd0d25 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 12 May 2020 09:31:59 +1000 Subject: [PATCH 17/24] Update to show new UseSerilog() overload including service provider --- README.md | 4 ++-- global.json | 2 +- samples/InlineInitializationSample/Program.cs | 7 ++----- samples/InlineInitializationSample/Startup.cs | 2 -- src/Serilog.AspNetCore/Serilog.AspNetCore.csproj | 4 ++-- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e14efc0..b33f583 100644 --- a/README.md +++ b/README.md @@ -192,13 +192,13 @@ app.UseSerilogRequestLogging(options => You can alternatively configure Serilog inline, in `BuildWebHost()`, using a delegate as shown below: ```csharp - .UseSerilog((hostingContext, loggerConfiguration) => loggerConfiguration + .UseSerilog((hostingContext, services, loggerConfiguration) => loggerConfiguration .ReadFrom.Configuration(hostingContext.Configuration) .Enrich.FromLogContext() .WriteTo.Console()) ``` -This has the advantage of making the `hostingContext`'s `Configuration` object available for [configuration of the logger](https://github.com/serilog/serilog-settings-configuration), but at the expense of losing `Exception`s raised earlier in program startup. +This has the advantage of making a service provider and the `hostingContext`'s `Configuration` object available for [configuration of the logger](https://github.com/serilog/serilog-settings-configuration), but at the expense of losing `Exception`s raised earlier in program startup. If this method is used, `Log.Logger` is assigned implicitly, and closed when the app is shut down. diff --git a/global.json b/global.json index 5442449..747f7cc 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { "allowPrerelease": false, - "version": "3.1.100", + "version": "3.1.201", "rollForward": "latestPatch" } } \ No newline at end of file diff --git a/samples/InlineInitializationSample/Program.cs b/samples/InlineInitializationSample/Program.cs index 9cf2e42..a06dbd1 100644 --- a/samples/InlineInitializationSample/Program.cs +++ b/samples/InlineInitializationSample/Program.cs @@ -13,11 +13,8 @@ public static void Main(string[] args) public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }) - .UseSerilog((hostingContext, loggerConfiguration) => loggerConfiguration + .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); }) + .UseSerilog((hostingContext, services, loggerConfiguration) => loggerConfiguration .ReadFrom.Configuration(hostingContext.Configuration) .Enrich.FromLogContext() .WriteTo.Debug() diff --git a/samples/InlineInitializationSample/Startup.cs b/samples/InlineInitializationSample/Startup.cs index 82f3bcd..2b71adf 100644 --- a/samples/InlineInitializationSample/Startup.cs +++ b/samples/InlineInitializationSample/Startup.cs @@ -1,10 +1,8 @@ -using System.Net; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Serilog; -using Serilog.Events; namespace InlineInitializationSample { diff --git a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj index 62cd77d..316d955 100644 --- a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj +++ b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj @@ -2,7 +2,7 @@ Serilog support for ASP.NET Core logging - 3.3.0 + 3.4.0 Microsoft;Serilog Contributors netstandard2.0;netcoreapp3.1 true @@ -27,7 +27,7 @@ - + From 10a28573d032857418b2b8d6d7028dc171db47e5 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Tue, 12 May 2020 09:34:06 +1000 Subject: [PATCH 18/24] Formatting --- samples/InlineInitializationSample/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/InlineInitializationSample/Program.cs b/samples/InlineInitializationSample/Program.cs index a06dbd1..b2c964c 100644 --- a/samples/InlineInitializationSample/Program.cs +++ b/samples/InlineInitializationSample/Program.cs @@ -13,7 +13,7 @@ public static void Main(string[] args) public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); }) + .ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup()) .UseSerilog((hostingContext, services, loggerConfiguration) => loggerConfiguration .ReadFrom.Configuration(hostingContext.Configuration) .Enrich.FromLogContext() From 815191263a6727cd697b33daa3b3ee31d1861e2e Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Wed, 13 May 2020 11:10:37 +1000 Subject: [PATCH 19/24] Allow `latestFeature` in global.json --- global.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 747f7cc..80992af 100644 --- a/global.json +++ b/global.json @@ -2,6 +2,6 @@ "sdk": { "allowPrerelease": false, "version": "3.1.201", - "rollForward": "latestPatch" + "rollForward": "latestFeature" } -} \ No newline at end of file +} From 84d8aa437bec509f8241c95aebc838d3acc474bb Mon Sep 17 00:00:00 2001 From: "Michael A. Volz (Flynn)" Date: Tue, 2 Jun 2020 11:31:59 +0200 Subject: [PATCH 20/24] Output formatting fix Moved .UseSerilog() before .ConfigureWebHostDefaults to enable correct formatting in console output. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b33f583..c1a3538 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,11 @@ public class Program ```csharp public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) + .UseSerilog() // <-- Add this line .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); - }) - .UseSerilog(); // <-- Add this line; + }); } ``` From a658f0b4e245a056efdd06b64f93877e8484eadd Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Wed, 3 Jun 2020 10:14:40 +1000 Subject: [PATCH 21/24] Update NuGet.org publishing key; don't skip symbol publishing --- appveyor.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 9f9e04e..6f56235 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,8 +11,7 @@ artifacts: deploy: - provider: NuGet api_key: - secure: gvYNwOSxj9Bq4erOm7alpWzHlEmNLLUV99VYKV1WF9qTJeDkvYpswoNHi9sAlZH4 - skip_symbols: true + secure: jZtLAmD4ALF9x1BZR1DiV3KhKlliWbzRUAw73xfMZaBsvz19123qLz2zw1+hPdcn on: branch: /^(master|dev)$/ - provider: GitHub From 63e73f61dd9ce81452a6f5f21fc678cb9027a6cc Mon Sep 17 00:00:00 2001 From: Sergey Komisarchik Date: Sat, 13 Jun 2020 12:57:01 +0300 Subject: [PATCH 22/24] configure RequestLoggingOptions --- samples/InlineInitializationSample/Startup.cs | 9 ++ .../AspNetCore/RequestLoggingOptions.cs | 24 ++++- .../SerilogApplicationBuilderExtensions.cs | 27 ++---- .../Serilog.AspNetCore.Tests.csproj | 12 ++- .../SerilogWebHostBuilderExtensionsTests.cs | 91 ++++++++++++++++++- .../Support/Extensions.cs | 12 +++ .../Support/SerilogWebApplicationFactory.cs | 13 +++ 7 files changed, 161 insertions(+), 27 deletions(-) create mode 100644 test/Serilog.AspNetCore.Tests/Support/Extensions.cs create mode 100644 test/Serilog.AspNetCore.Tests/Support/SerilogWebApplicationFactory.cs diff --git a/samples/InlineInitializationSample/Startup.cs b/samples/InlineInitializationSample/Startup.cs index 2b71adf..c8dc31e 100644 --- a/samples/InlineInitializationSample/Startup.cs +++ b/samples/InlineInitializationSample/Startup.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Serilog; +using Serilog.AspNetCore; namespace InlineInitializationSample { @@ -10,6 +11,14 @@ public class Startup { public void ConfigureServices(IServiceCollection services) { + services.Configure(o => + { + o.EnrichDiagnosticContext = (diagnosticContext, httpContext) => + { + diagnosticContext.Set("RemoteIpAddress", httpContext.Connection.RemoteIpAddress.MapToIPv4()); + }; + }); + services.AddControllersWithViews(); } diff --git a/src/Serilog.AspNetCore/AspNetCore/RequestLoggingOptions.cs b/src/Serilog.AspNetCore/AspNetCore/RequestLoggingOptions.cs index 6a69f55..8d86582 100644 --- a/src/Serilog.AspNetCore/AspNetCore/RequestLoggingOptions.cs +++ b/src/Serilog.AspNetCore/AspNetCore/RequestLoggingOptions.cs @@ -1,4 +1,4 @@ -// Copyright 2019 Serilog Contributors +// Copyright 2019-2020 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,10 +21,20 @@ namespace Serilog.AspNetCore { /// - /// Contains options for the . + /// Contains options for the . /// public class RequestLoggingOptions { + const string DefaultRequestCompletionMessageTemplate = + "HTTP {RequestMethod} {RequestPath} responded {StatusCode} in {Elapsed:0.0000} ms"; + + static LogEventLevel DefaultGetLevel(HttpContext ctx, double _, Exception ex) => + ex != null + ? LogEventLevel.Error + : ctx.Response.StatusCode > 499 + ? LogEventLevel.Error + : LogEventLevel.Information; + /// /// Gets or sets the message template. The default value is /// "HTTP {RequestMethod} {RequestPath} responded {StatusCode} in {Elapsed:0.0000} ms". The @@ -52,13 +62,19 @@ public class RequestLoggingOptions /// public Action EnrichDiagnosticContext { get; set; } - /// /// The logger through which request completion events will be logged. The default is to use the /// static class. /// public ILogger Logger { get; set; } - internal RequestLoggingOptions() { } + /// + /// Constructor + /// + public RequestLoggingOptions() + { + GetLevel = DefaultGetLevel; + MessageTemplate = DefaultRequestCompletionMessageTemplate; + } } } diff --git a/src/Serilog.AspNetCore/SerilogApplicationBuilderExtensions.cs b/src/Serilog.AspNetCore/SerilogApplicationBuilderExtensions.cs index 838fd94..b163fc7 100644 --- a/src/Serilog.AspNetCore/SerilogApplicationBuilderExtensions.cs +++ b/src/Serilog.AspNetCore/SerilogApplicationBuilderExtensions.cs @@ -1,4 +1,4 @@ -// Copyright 2019 Serilog Contributors +// Copyright 2019-2020 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,10 +13,12 @@ // limitations under the License. using System; + using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; + using Serilog.AspNetCore; -using Serilog.Events; namespace Serilog { @@ -25,16 +27,6 @@ namespace Serilog /// public static class SerilogApplicationBuilderExtensions { - const string DefaultRequestCompletionMessageTemplate = - "HTTP {RequestMethod} {RequestPath} responded {StatusCode} in {Elapsed:0.0000} ms"; - - static LogEventLevel DefaultGetLevel(HttpContext ctx, double _, Exception ex) => - ex != null - ? LogEventLevel.Error - : ctx.Response.StatusCode > 499 - ? LogEventLevel.Error - : LogEventLevel.Information; - /// /// Adds middleware for streamlined request logging. Instead of writing HTTP request information /// like method, path, timing, status code and exception details @@ -70,12 +62,9 @@ public static IApplicationBuilder UseSerilogRequestLogging( Action configureOptions = null) { if (app == null) throw new ArgumentNullException(nameof(app)); - - var opts = new RequestLoggingOptions - { - GetLevel = DefaultGetLevel, - MessageTemplate = DefaultRequestCompletionMessageTemplate - }; + + var opts = app.ApplicationServices.GetService>()?.Value ?? new RequestLoggingOptions(); + configureOptions?.Invoke(opts); if (opts.MessageTemplate == null) diff --git a/test/Serilog.AspNetCore.Tests/Serilog.AspNetCore.Tests.csproj b/test/Serilog.AspNetCore.Tests/Serilog.AspNetCore.Tests.csproj index d6e81ac..99eef06 100644 --- a/test/Serilog.AspNetCore.Tests/Serilog.AspNetCore.Tests.csproj +++ b/test/Serilog.AspNetCore.Tests/Serilog.AspNetCore.Tests.csproj @@ -14,9 +14,17 @@ - - + + + + + + + + + + diff --git a/test/Serilog.AspNetCore.Tests/SerilogWebHostBuilderExtensionsTests.cs b/test/Serilog.AspNetCore.Tests/SerilogWebHostBuilderExtensionsTests.cs index 6aa9b1f..e95368d 100644 --- a/test/Serilog.AspNetCore.Tests/SerilogWebHostBuilderExtensionsTests.cs +++ b/test/Serilog.AspNetCore.Tests/SerilogWebHostBuilderExtensionsTests.cs @@ -1,16 +1,103 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; +using System.Linq; +using System.Threading.Tasks; + using Xunit; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.AspNetCore.Builder; + +using Serilog.Filters; +using Serilog.AspNetCore.Tests.Support; + namespace Serilog.AspNetCore.Tests { - public class SerilogWebHostBuilderExtensionsTests + public class SerilogWebHostBuilderExtensionsTests : IClassFixture { + SerilogWebApplicationFactory _web; + + public SerilogWebHostBuilderExtensionsTests(SerilogWebApplicationFactory web) + { + _web = web; + } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public async Task DisposeShouldBeHandled(bool dispose) + { + var logger = new DisposeTrackingLogger(); + using (var web = Setup(logger, dispose)) + { + await web.CreateClient().GetAsync("/"); + } + + Assert.Equal(dispose, logger.IsDisposed); + } + [Fact] - public void Todo() + public async Task RequestLoggingMiddlewareShouldEnrich() { + var (sink, web) = Setup(options => + { + options.EnrichDiagnosticContext += (diagnosticContext, httpContext) => + { + diagnosticContext.Set("SomeInteger", 42); + }; + }); + + await web.CreateClient().GetAsync("/resource"); + + Assert.NotEmpty(sink.Writes); + + var completionEvent = sink.Writes.Where(logEvent => Matching.FromSource()(logEvent)).FirstOrDefault(); + + Assert.Equal(42, completionEvent.Properties["SomeInteger"].LiteralValue()); + Assert.Equal("string", completionEvent.Properties["SomeString"].LiteralValue()); + Assert.Equal("/resource", completionEvent.Properties["RequestPath"].LiteralValue()); + Assert.Equal(200, completionEvent.Properties["StatusCode"].LiteralValue()); + Assert.Equal("GET", completionEvent.Properties["RequestMethod"].LiteralValue()); + Assert.True(completionEvent.Properties.ContainsKey("Elapsed")); + } + + WebApplicationFactory Setup(ILogger logger, bool dispose, Action configureOptions = null) + { + var web = _web.WithWebHostBuilder( + builder => builder + .ConfigureServices(sc => sc.Configure(options => + { + options.Logger = logger; + options.EnrichDiagnosticContext += (diagnosticContext, httpContext) => + { + diagnosticContext.Set("SomeString", "string"); + }; + })) + .Configure(app => + { + app.UseSerilogRequestLogging(configureOptions); + app.Run(_ => Task.CompletedTask); // 200 OK + }) + .UseSerilog(logger, dispose)); + + return web; + } + + (SerilogSink, WebApplicationFactory) Setup(Action configureOptions = null) + { + var sink = new SerilogSink(); + var logger = new LoggerConfiguration() + .Enrich.FromLogContext() + .WriteTo.Sink(sink) + .CreateLogger(); + + var web = Setup(logger, true, configureOptions); + return (sink, web); } } } \ No newline at end of file diff --git a/test/Serilog.AspNetCore.Tests/Support/Extensions.cs b/test/Serilog.AspNetCore.Tests/Support/Extensions.cs new file mode 100644 index 0000000..54e6a1f --- /dev/null +++ b/test/Serilog.AspNetCore.Tests/Support/Extensions.cs @@ -0,0 +1,12 @@ +using Serilog.Events; + +namespace Serilog.AspNetCore.Tests.Support +{ + public static class Extensions + { + public static object LiteralValue(this LogEventPropertyValue @this) + { + return ((ScalarValue)@this).Value; + } + } +} diff --git a/test/Serilog.AspNetCore.Tests/Support/SerilogWebApplicationFactory.cs b/test/Serilog.AspNetCore.Tests/Support/SerilogWebApplicationFactory.cs new file mode 100644 index 0000000..92e5d09 --- /dev/null +++ b/test/Serilog.AspNetCore.Tests/Support/SerilogWebApplicationFactory.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc.Testing; + +namespace Serilog.AspNetCore.Tests.Support +{ + public class SerilogWebApplicationFactory : WebApplicationFactory + { + protected override IWebHostBuilder CreateWebHostBuilder() => new WebHostBuilder().UseStartup(); + protected override void ConfigureWebHost(IWebHostBuilder builder) => builder.UseContentRoot("."); + } + + public class TestStartup { } +} From 1af66c29b639503d4d9010065c0bff28ca6d78d5 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Fri, 24 Jul 2020 11:18:53 +1000 Subject: [PATCH 23/24] Drop the -dev suffix from the Serilog.Extensions.Hosting dependency --- src/Serilog.AspNetCore/Serilog.AspNetCore.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj index 316d955..31f5836 100644 --- a/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj +++ b/src/Serilog.AspNetCore/Serilog.AspNetCore.csproj @@ -27,7 +27,7 @@ - + From d05c38c26d3441921bbd51fd8b8cef6bb1f87fc2 Mon Sep 17 00:00:00 2001 From: Nicholas Blumhardt Date: Fri, 24 Jul 2020 11:39:08 +1000 Subject: [PATCH 24/24] Work around 500 error when attempting to publish symbols --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 6f56235..39b0037 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,6 +10,7 @@ artifacts: - path: artifacts/Serilog.*.nupkg deploy: - provider: NuGet + skip_symbols: true api_key: secure: jZtLAmD4ALF9x1BZR1DiV3KhKlliWbzRUAw73xfMZaBsvz19123qLz2zw1+hPdcn on: