From 16d87735a541cb0f1819ca8ab10ac7397244f8da Mon Sep 17 00:00:00 2001 From: Rolf Kristensen Date: Tue, 21 Dec 2021 00:43:24 +0100 Subject: [PATCH] Version 5.0 Release Candidate 1 (#742) --- CHANGELOG.MD | 19 ++++++++++++++++++- .../ASP.NET 4.6.1 - VS2017/packages.config | 2 +- .../NLog.Web.AspNetCore.csproj | 12 ++++++------ .../NLogRequestLoggingMiddleware.cs | 2 +- src/NLog.Web/NLog.Web.csproj | 2 +- src/NLog.Web/NLogRequestLoggingModule.cs | 2 +- 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 98907d2e..d062e76c 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -4,6 +4,23 @@ See also [releases](https://github.com/NLog/NLog.Web/releases) and [milestones]( Date format: (year/month/day) +### v5.0-rc1 (2021/12/20) + +- **NLog.Web.AspNetCore** + - [#734](https://github.com/NLog/NLog.Web/pull/734) LogManager.Setup() - Added support for RegisterAspNetLayoutRenderer (#734) (@snakefoot) + - [#735](https://github.com/NLog/NLog.Web/pull/735) Changed format Culture to InvariantCulture to match default NLog Culture (#735) (@snakefoot) + - [#736](https://github.com/NLog/NLog.Web/pull/736) Added sample for ASP.NET Core 6.0 on .NET 6 (#736) (@ThomasArdal) + - [#740](https://github.com/NLog/NLog.Web/pull/740) Added ${aspnet-request-routeparameters} (#740) (@ThomasArdal) + - [#741](https://github.com/NLog/NLog.Web/pull/741) Changed from Convert.ToString to IValueFormatter to be like NLog default (#741) (@snakefoot) + +- **NLog.Web** + - [#734](https://github.com/NLog/NLog.Web/pull/734) LogManager.Setup() - Added support for RegisterNLogWeb + RegisterAspNetLayoutRenderer (#734) (@snakefoot) + - [#735](https://github.com/NLog/NLog.Web/pull/735) Changed format Culture to InvariantCulture to match default NLog Culture (#735) (@snakefoot) + - [#740](https://github.com/NLog/NLog.Web/pull/740) Added ${aspnet-request-routeparameters} (#740) (@ThomasArdal) + - [#741](https://github.com/NLog/NLog.Web/pull/741) Changed from Convert.ToString to IValueFormatter to be like NLog default (#741) (@snakefoot) + +See also [Release post for NLog 5](https://nlog-project.org/2021/08/25/nlog-5-0-preview1-ready.html) + ### v5.0-preview 3 (2021/10/28) - **NLog.Web.AspNetCore** @@ -18,7 +35,7 @@ Date format: (year/month/day) - [#700](https://github.com/NLog/NLog.Web/pull/700) Added W3CExtendedLogLayout for writing W3C Extended Logs (#700) (@snakefoot) - [#697](https://github.com/NLog/NLog.Web/pull/697) Replaced SingleAsArray with OutputFormat = JsonArray + JsonDictionary (#697) (@snakefoot) -See [Release post for NLog 5](https://nlog-project.org/2021/08/25/nlog-5-0-preview1-ready.html) +See also [Release post for NLog 5](https://nlog-project.org/2021/08/25/nlog-5-0-preview1-ready.html) ### v4.14 (2021/08/28) - **NLog.Web.AspNetCore** diff --git a/examples/ASP.NET 4.6.1/Visual Studio 2017/ASP.NET 4.6.1 - VS2017/packages.config b/examples/ASP.NET 4.6.1/Visual Studio 2017/ASP.NET 4.6.1 - VS2017/packages.config index a42a19aa..a34e89c2 100644 --- a/examples/ASP.NET 4.6.1/Visual Studio 2017/ASP.NET 4.6.1 - VS2017/packages.config +++ b/examples/ASP.NET 4.6.1/Visual Studio 2017/ASP.NET 4.6.1 - VS2017/packages.config @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/NLog.Web.AspNetCore/NLog.Web.AspNetCore.csproj b/src/NLog.Web.AspNetCore/NLog.Web.AspNetCore.csproj index 1cef2038..8852fdf6 100644 --- a/src/NLog.Web.AspNetCore/NLog.Web.AspNetCore.csproj +++ b/src/NLog.Web.AspNetCore/NLog.Web.AspNetCore.csproj @@ -23,11 +23,11 @@ Supported platforms: ## Improvements -- Replaced platform NetCoreApp3.0 with NetCoreApp3.1 and added Net5.0 (#701) (@snakefoot) -- Dropped support for ASP.NET Core 1 and NetStandard1.5 + Net452 (#683) (@304NotModified) -- Enabled ShutdownOnDispose by default to follow lifetime of the ServiceProvider (#691) (@snakefoot) -- Added W3CExtendedLogLayout for writing W3C Extended Logs (#700) (@snakefoot) -- Replaced SingleAsArray with OutputFormat = JsonArray + JsonDictionary (#697) (@snakefoot) +- [#734] LogManager.Setup() - Added support for RegisterAspNetLayoutRenderer (#734) (@snakefoot) +- [#735] Changed format Culture to InvariantCulture to match default NLog Culture (#735) (@snakefoot) +- [#736] Added sample for ASP.NET Core 6.0 on .NET 6 (#736) (@ThomasArdal) +- [#740] Added ${aspnet-request-routeparameters} (#740) (@ThomasArdal) +- [#741] Changed from Convert.ToString to IValueFormatter to be like NLog default (#741) (@snakefoot) Full changelog: https://github.com/NLog/NLog.Web/releases @@ -78,7 +78,7 @@ NLog 5 release post: https://nlog-project.org/2021/08/25/nlog-5-0-preview1-ready $(DefineConstants);ASP_NET_CORE;ASP_NET_CORE3 - + diff --git a/src/NLog.Web.AspNetCore/NLogRequestLoggingMiddleware.cs b/src/NLog.Web.AspNetCore/NLogRequestLoggingMiddleware.cs index 69872bab..3b99bafe 100644 --- a/src/NLog.Web.AspNetCore/NLogRequestLoggingMiddleware.cs +++ b/src/NLog.Web.AspNetCore/NLogRequestLoggingMiddleware.cs @@ -66,7 +66,7 @@ private bool LogHttpRequest(HttpContext httpContext, Exception exception) else { var statusCode = httpContext.Response?.StatusCode ?? 0; - if (statusCode < 100 || statusCode >= 400) + if (statusCode < 100 || (statusCode >= 400 && statusCode < 600)) { _logger.LogWarning("HttpRequest Failed"); } diff --git a/src/NLog.Web/NLog.Web.csproj b/src/NLog.Web/NLog.Web.csproj index 80402db2..4c09edff 100644 --- a/src/NLog.Web/NLog.Web.csproj +++ b/src/NLog.Web/NLog.Web.csproj @@ -49,7 +49,7 @@ See https://github.com/NLog/NLog.Web/releases - + diff --git a/src/NLog.Web/NLogRequestLoggingModule.cs b/src/NLog.Web/NLogRequestLoggingModule.cs index dd07d53e..2f407cca 100644 --- a/src/NLog.Web/NLogRequestLoggingModule.cs +++ b/src/NLog.Web/NLogRequestLoggingModule.cs @@ -33,7 +33,7 @@ private void LogHttpRequest(object sender, EventArgs e) { if (exception != null) Logger.Error(exception, "HttpRequest Exception"); - else if (statusCode < 100 || statusCode >= 400) + else if (statusCode < 100 || (statusCode >= 400 && statusCode < 600)) Logger.Warn("HttpRequest Failed"); else Logger.Info("HttpRequest Completed");