Skip to content

Commit a81ebf7

Browse files
committed
feat: Do not report EOF on status checks on TLS ports and reduce logging of regular connections without debug
1 parent 32e19d2 commit a81ebf7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lc-lib/transports/tcp/receivertcp.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"crypto/tls"
2222
"crypto/x509"
2323
"fmt"
24+
"io"
2425
"net"
2526
"sync"
2627
"time"
@@ -222,7 +223,7 @@ func (t *receiverTCP) getTLSConfig() (tlsConfig *tls.Config) {
222223

223224
// startConnection sets up a new connection
224225
func (t *receiverTCP) startConnection(socket *net.TCPConn) {
225-
log.Noticef("[R %s - %s] New connection", socket.LocalAddr().String(), socket.RemoteAddr().String())
226+
log.Debugf("[R %s - %s] New connection", socket.LocalAddr().String(), socket.RemoteAddr().String())
226227

227228
var connectionSocket connectionSocket
228229
if t.config.EnableTls {
@@ -252,7 +253,7 @@ func (t *receiverTCP) connectionRoutine(socket net.Conn, conn *connection) {
252253
}); err != nil {
253254
if err == ErrHardCloseRequested {
254255
log.Noticef("[R %s - %s] Client forcefully disconnected", socket.LocalAddr().String(), socket.RemoteAddr().String())
255-
} else {
256+
} else if err != io.EOF { // Ignore io.EOF as it usually means a graceful close without starting up, such as a status check on a TLS port
256257
log.Errorf("[R %s - %s] Client failed: %s", socket.LocalAddr().String(), socket.RemoteAddr().String(), err)
257258
}
258259
} else {

0 commit comments

Comments
 (0)