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; }