fix use of hclog logger (#7264)

This commit is contained in:
R.B. Boyer 2020-02-12 09:37:16 -06:00 committed by GitHub
parent 3a15fb9dde
commit 80b1165976
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View File

@ -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
}

View File

@ -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(),
)

View File

@ -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)
}
}()