Skip to content

Commit af567d2

Browse files
authored
feat: connection add debug log (#1118)
1 parent 5af5d6d commit af567d2

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

internal/remote/remote_client.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,20 @@ func (c *remotingClient) receiveResponse(r *tcpConnWrapper) {
180180
return
181181
}
182182
// ignore name server connection read timeout
183+
var isTimeout bool
183184
if netErr, ok := err.(net.Error); ok && netErr.Timeout() {
184-
rlog.Debug("conn error, close connection", map[string]interface{}{
185+
isTimeout = true
186+
}
187+
if !(err == io.EOF || isTimeout) {
188+
rlog.Error("conn error, close connection", map[string]interface{}{
189+
"remoteAddr": r.RemoteAddr(),
190+
"localAddr": r.LocalAddr(),
185191
rlog.LogKeyUnderlayError: err,
186192
})
187-
} else if err != io.EOF {
188-
rlog.Error("conn error, close connection", map[string]interface{}{
193+
} else {
194+
rlog.Debug("conn error, close connection", map[string]interface{}{
195+
"remoteAddr": r.RemoteAddr(),
196+
"localAddr": r.LocalAddr(),
189197
rlog.LogKeyUnderlayError: err,
190198
})
191199
}

0 commit comments

Comments
 (0)