mirror of https://github.com/status-im/consul.git
fix use of hclog logger (#7264)
This commit is contained in:
parent
3a15fb9dde
commit
80b1165976
|
@ -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…
Reference in New Issue