#76 - Suppress shutdown error logs.

This commit is contained in:
Chris Ross 2014-10-24 12:15:07 -07:00
parent a42a069dcf
commit 6e2b94dde3
2 changed files with 15 additions and 2 deletions

View File

@ -64,6 +64,11 @@ namespace Microsoft.AspNet.Server.WebListener
}
}
internal static void LogVerbose(ILogger logger, string location, Exception exception)
{
LogVerbose(logger, location + "; " + exception.ToString());
}
internal static void LogException(ILogger logger, string location, Exception exception)
{
if (logger == null)

View File

@ -123,8 +123,15 @@ namespace Microsoft.AspNet.Server.WebListener
}
catch (Exception exception)
{
LogHelper.LogException(_logger, "ListenForNextRequestAsync", exception);
Contract.Assert(!_listener.IsListening);
Contract.Assert(_stopping);
if (_stopping)
{
LogHelper.LogVerbose(_logger, "ListenForNextRequestAsync-Stopping", exception);
}
else
{
LogHelper.LogException(_logger, "ListenForNextRequestAsync", exception);
}
return;
}
try
@ -197,6 +204,7 @@ namespace Microsoft.AspNet.Server.WebListener
public void Dispose()
{
LogHelper.LogInfo(_logger, "Stop");
_stopping = true;
// Wait for active requests to drain
if (_outstandingRequests > 0)