Merge pull request #375 from benaadams/log-scope-only-enabled
Proposal: Start log scope only if logging is enabled
This commit is contained in:
commit
e323a14b43
|
|
@ -105,7 +105,9 @@ namespace Microsoft.AspNet.Hosting.Internal
|
|||
|
||||
try
|
||||
{
|
||||
using (logger.BeginScope("Request Id: {RequestId}", requestIdentifier))
|
||||
using (logger.IsEnabled(LogLevel.Critical)
|
||||
? logger.BeginScope("Request Id: {RequestId}", requestIdentifier)
|
||||
: null)
|
||||
{
|
||||
await application(httpContext);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue