未验证 提交 f09e33b7 编写于 作者: H Heejae Chang 提交者: GitHub

add more detail on why connection went away in log file. (#22864)

上级 38664665
......@@ -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()}");
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册