Start log scope only if logging is enabled
This commit is contained in:
parent
c426fa97d5
commit
7e52a00499
|
|
@ -104,7 +104,9 @@ namespace Microsoft.AspNet.Hosting.Internal
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (logger.BeginScope("Request Id: {RequestId}", requestIdentifier))
|
using (logger.IsEnabled(LogLevel.Critical)
|
||||||
|
? logger.BeginScope("Request Id: {RequestId}", requestIdentifier)
|
||||||
|
: null)
|
||||||
{
|
{
|
||||||
contextAccessor.HttpContext = httpContext;
|
contextAccessor.HttpContext = httpContext;
|
||||||
await application(httpContext);
|
await application(httpContext);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue