From f09e33b71bb5738fa3c08aa0a087c8df4306c789 Mon Sep 17 00:00:00 2001 From: Heejae Chang Date: Tue, 31 Oct 2017 02:19:25 -0700 Subject: [PATCH] add more detail on why connection went away in log file. (#22864) --- .../Remote/ServiceHub/Shared/ServiceHubServiceBase.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Workspaces/Remote/ServiceHub/Shared/ServiceHubServiceBase.cs b/src/Workspaces/Remote/ServiceHub/Shared/ServiceHubServiceBase.cs index 69aebe71a34..8272c267c83 100644 --- a/src/Workspaces/Remote/ServiceHub/Shared/ServiceHubServiceBase.cs +++ b/src/Workspaces/Remote/ServiceHub/Shared/ServiceHubServiceBase.cs @@ -149,10 +149,13 @@ private void OnRpcDisconnected(object sender, JsonRpcDisconnectedEventArgs e) if (e.Reason != DisconnectedReason.Disposed) { - // this is common for us since we close connection forcefully when operation - // is cancelled. use Warning level so that by default, it doesn't write out to - // servicehub\log files. one can still make this to write logs by opting in. - Log(TraceEventType.Warning, $"Client stream disconnected unexpectedly: {e.Exception?.GetType().Name} {e.Exception?.Message}"); + // we no longer close connection forcefully. so connection shouldn't go away + // in normal situation. if it happens, log why it did in more detail. + LogError($@"Client stream disconnected unexpectedly: +{nameof(e.Description)}: {e.Description} +{nameof(e.Reason)}: {e.Reason} +{nameof(e.LastMessage)}: {e.LastMessage} +{nameof(e.Exception)}: {e.Exception?.ToString()}"); } } -- GitLab