Merge branch 'release/2.2' => 'master'

This commit is contained in:
David Fowler 2018-09-07 01:29:38 -07:00
Родитель c3d0767375 795a2238eb
Коммит 5543d29af1
1 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -94,7 +94,8 @@ namespace Microsoft.AspNetCore.Hosting.Internal
private class HostingLogScope : IReadOnlyList<KeyValuePair<string, object>>
{
private readonly HttpContext _httpContext;
private readonly string _path;
private readonly string _traceIdentifier;
private readonly string _correlationId;
private string _cachedToString;
@ -113,11 +114,11 @@ namespace Microsoft.AspNetCore.Hosting.Internal
{
if (index == 0)
{
return new KeyValuePair<string, object>("RequestId", _httpContext.TraceIdentifier);
return new KeyValuePair<string, object>("RequestId", _traceIdentifier);
}
else if (index == 1)
{
return new KeyValuePair<string, object>("RequestPath", _httpContext.Request.Path.ToString());
return new KeyValuePair<string, object>("RequestPath", _path);
}
else if (index == 2)
{
@ -130,7 +131,8 @@ namespace Microsoft.AspNetCore.Hosting.Internal
public HostingLogScope(HttpContext httpContext, string correlationId)
{
_httpContext = httpContext;
_traceIdentifier = httpContext.TraceIdentifier;
_path = httpContext.Request.Path.ToString();
_correlationId = correlationId;
}
@ -141,8 +143,8 @@ namespace Microsoft.AspNetCore.Hosting.Internal
_cachedToString = string.Format(
CultureInfo.InvariantCulture,
"RequestId:{0} RequestPath:{1}",
_httpContext.TraceIdentifier,
_httpContext.Request.Path);
_traceIdentifier,
_path);
}
return _cachedToString;