From b85ec52387332d0c975059c550635a8a3743dde8 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Wed, 13 Mar 2019 19:20:04 +0100 Subject: [PATCH] rpc/ctrl: nicer perr info debug log messages --- rpc/grpcclientidentity/authlistener_grpc_adaptor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpc/grpcclientidentity/authlistener_grpc_adaptor.go b/rpc/grpcclientidentity/authlistener_grpc_adaptor.go index accd124..3c62cf4 100644 --- a/rpc/grpcclientidentity/authlistener_grpc_adaptor.go +++ b/rpc/grpcclientidentity/authlistener_grpc_adaptor.go @@ -105,11 +105,12 @@ func NewInterceptors(logger Logger, clientIdentityKey interface{}) (unary grpc.U if !ok { panic("peer.FromContext expected to return a peer in grpc.UnaryServerInterceptor") } - logger.WithField("peer", fmt.Sprintf("%v", p)).Debug("peer") + logger.WithField("peer_addr", fmt.Sprintf("%s", p.Addr)).Debug("peer addr") a, ok := p.AuthInfo.(*authConnAuthType) if !ok { panic(fmt.Sprintf("NewInterceptors must be used in combination with grpc.NewTransportCredentials, but got auth type %T", p.AuthInfo)) } + logger.WithField("peer_client_identity", a.clientIdentity).Debug("peer client identity") ctx = context.WithValue(ctx, clientIdentityKey, a.clientIdentity) return handler(ctx, req) }