From 8f46065ab58665c92d93b803b8e57aad51d5195e Mon Sep 17 00:00:00 2001 From: cthuang Date: Mon, 20 Dec 2021 10:58:06 +0000 Subject: [PATCH] TUN-5570: Only log RPC server events at error level to reduce noise --- quic/quic_protocol.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/quic/quic_protocol.go b/quic/quic_protocol.go index bd69c3d6..507d3137 100644 --- a/quic/quic_protocol.go +++ b/quic/quic_protocol.go @@ -155,13 +155,16 @@ func NewRPCServerStream(stream io.ReadWriteCloser, protocol ProtocolSignature) ( } func (s *RPCServerStream) Serve(sessionManager tunnelpogs.SessionManager, logger *zerolog.Logger) error { - rpcTransport := tunnelrpc.NewTransportLogger(logger, rpc.StreamTransport(s)) + // RPC logs are very robust, create a new logger that only logs error to reduce noise + rpcLogger := logger.Level(zerolog.ErrorLevel) + rpcTransport := tunnelrpc.NewTransportLogger(&rpcLogger, rpc.StreamTransport(s)) defer rpcTransport.Close() main := tunnelpogs.SessionManager_ServerToClient(sessionManager) rpcConn := rpc.NewConn( rpcTransport, rpc.MainInterface(main.Client), + tunnelrpc.ConnLog(&rpcLogger), ) defer rpcConn.Close() @@ -179,7 +182,7 @@ func DetermineProtocol(stream io.Reader) (ProtocolSignature, error) { case RPCStreamProtocolSignature: return RPCStreamProtocolSignature, nil default: - return ProtocolSignature{}, fmt.Errorf("Unknown signature %v", signature) + return ProtocolSignature{}, fmt.Errorf("unknown signature %v", signature) } }