From 8f1f3fa10b141de3682a378d231224cb37a68014 Mon Sep 17 00:00:00 2001 From: Igor Drozdov Date: Fri, 6 May 2022 18:45:30 +0400 Subject: Log the error that happens on sconn.Wait() Warning level is used because a non-nil error is logged even for successful scenarios We plan to use it for debug reasons --- internal/sshd/sshd.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'internal/sshd/sshd.go') diff --git a/internal/sshd/sshd.go b/internal/sshd/sshd.go index 49b8ab9..8dbeebf 100644 --- a/internal/sshd/sshd.go +++ b/internal/sshd/sshd.go @@ -204,9 +204,11 @@ func (s *Server) handleConn(ctx context.Context, nconn net.Conn) { success = session.success }) + reason := sconn.Wait() ctxlog.WithFields(log.Fields{ "duration_s": time.Since(started).Seconds(), "establish_session_duration_s": establishSessionDuration, + "reason": reason, }).Info("server: handleConn: done") } -- cgit v1.2.1