From b6bbc29498d48e0ddd5776fe83407ed1fb67933f Mon Sep 17 00:00:00 2001 From: penenkel Date: Tue, 2 Apr 2019 21:33:15 +0200 Subject: [PATCH] HostingLogScope now logs RequestPath as Request.BasePath+Request.Path #8942 (#8944) --- src/Hosting/Hosting/src/Internal/HostingLoggerExtensions.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Hosting/Hosting/src/Internal/HostingLoggerExtensions.cs b/src/Hosting/Hosting/src/Internal/HostingLoggerExtensions.cs index ce333f232c..e20f8a14ed 100644 --- a/src/Hosting/Hosting/src/Internal/HostingLoggerExtensions.cs +++ b/src/Hosting/Hosting/src/Internal/HostingLoggerExtensions.cs @@ -132,7 +132,9 @@ namespace Microsoft.AspNetCore.Hosting.Internal public HostingLogScope(HttpContext httpContext, string correlationId) { _traceIdentifier = httpContext.TraceIdentifier; - _path = httpContext.Request.Path.ToString(); + _path = (httpContext.Request.PathBase.HasValue + ? httpContext.Request.PathBase + httpContext.Request.Path + : httpContext.Request.Path).ToString(); _correlationId = correlationId; }