fix use of hclog logger (#7264)

pull/7276/head
R.B. Boyer 5 years ago committed by GitHub
parent 3a15fb9dde
commit 80b1165976
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -68,8 +68,7 @@ func (s *Server) listen(listener net.Listener) {
free, err := s.rpcConnLimiter.Accept(conn)
if err != nil {
s.rpcLogger().Error("rejecting RPC conn from %s"+
" rpc_max_conns_per_client exceeded", conn.RemoteAddr().String())
s.rpcLogger().Error("rejecting RPC conn from because rpc_max_conns_per_client exceeded", "conn", logConn(conn))
conn.Close()
continue
}
@ -138,7 +137,7 @@ func (s *Server) handleConn(conn net.Conn, isTLS bool) {
case pool.RPCTLS:
// Don't allow malicious client to create TLS-in-TLS for ever.
if isTLS {
s.rpcLogger().Error("TLS connection attempting to establish inner TLS connection %s", logConn(conn))
s.rpcLogger().Error("TLS connection attempting to establish inner TLS connection", "conn", logConn(conn))
conn.Close()
return
}
@ -154,7 +153,7 @@ func (s *Server) handleConn(conn net.Conn, isTLS bool) {
case pool.RPCTLSInsecure:
// Don't allow malicious client to create TLS-in-TLS for ever.
if isTLS {
s.rpcLogger().Error("TLS connection attempting to establish inner TLS connection %s", logConn(conn))
s.rpcLogger().Error("TLS connection attempting to establish inner TLS connection", "conn", logConn(conn))
conn.Close()
return
}

@ -205,7 +205,7 @@ func (s *Service) Dial(ctx context.Context, resolver Resolver) (net.Conn, error)
tlsConn.Close()
return nil, err
}
s.logger.Debug("successfully connected to service instance", addr,
s.logger.Debug("successfully connected to service instance",
"address", addr,
"identity", certURI.URI(),
)

@ -40,7 +40,7 @@ func New(logger hclog.Logger, r *raft.Raft) (*Snapshot, error) {
}
defer func() {
if err := snap.Close(); err != nil {
logger.Error("Failed to close Raft snapshot: %v", err)
logger.Error("Failed to close Raft snapshot", "error", err)
}
}()

Loading…
Cancel
Save