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)
|
free, err := s.rpcConnLimiter.Accept(conn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.rpcLogger().Error("rejecting RPC conn from %s"+
|
s.rpcLogger().Error("rejecting RPC conn from because rpc_max_conns_per_client exceeded", "conn", logConn(conn))
|
||||||
" rpc_max_conns_per_client exceeded", conn.RemoteAddr().String())
|
|
||||||
conn.Close()
|
conn.Close()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -138,7 +137,7 @@ func (s *Server) handleConn(conn net.Conn, isTLS bool) {
|
||||||
case pool.RPCTLS:
|
case pool.RPCTLS:
|
||||||
// Don't allow malicious client to create TLS-in-TLS for ever.
|
// Don't allow malicious client to create TLS-in-TLS for ever.
|
||||||
if isTLS {
|
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()
|
conn.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -154,7 +153,7 @@ func (s *Server) handleConn(conn net.Conn, isTLS bool) {
|
||||||
case pool.RPCTLSInsecure:
|
case pool.RPCTLSInsecure:
|
||||||
// Don't allow malicious client to create TLS-in-TLS for ever.
|
// Don't allow malicious client to create TLS-in-TLS for ever.
|
||||||
if isTLS {
|
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()
|
conn.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,7 +205,7 @@ func (s *Service) Dial(ctx context.Context, resolver Resolver) (net.Conn, error)
|
||||||
tlsConn.Close()
|
tlsConn.Close()
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
s.logger.Debug("successfully connected to service instance", addr,
|
s.logger.Debug("successfully connected to service instance",
|
||||||
"address", addr,
|
"address", addr,
|
||||||
"identity", certURI.URI(),
|
"identity", certURI.URI(),
|
||||||
)
|
)
|
||||||
|
|
|
@ -40,7 +40,7 @@ func New(logger hclog.Logger, r *raft.Raft) (*Snapshot, error) {
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
if err := snap.Close(); err != nil {
|
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