From 855d82a89e90390e16ac8ce5a4cd80caa392d872 Mon Sep 17 00:00:00 2001 From: Saikat Roychowdhury Date: Thu, 5 Dec 2024 05:05:39 +0000 Subject: [PATCH] Add gRPC method name to logs --- pkg/csi_driver/utils.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/csi_driver/utils.go b/pkg/csi_driver/utils.go index 63e0c5847..ab15eacd9 100644 --- a/pkg/csi_driver/utils.go +++ b/pkg/csi_driver/utils.go @@ -52,13 +52,12 @@ func NewNodeServiceCapability(cap csi.NodeServiceCapability_RPC_Type) *csi.NodeS } func logGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { - klog.V(3).Infof("GRPC call: %s", info.FullMethod) - klog.V(5).Infof("GRPC request: %+v", pbSanitizer.StripSecretsCSI03(req).String()) + klog.V(5).Infof("GRPC call: %s, GRPC request: %+v", info.FullMethod, pbSanitizer.StripSecretsCSI03(req).String()) resp, err := handler(ctx, req) if err != nil { - klog.Errorf("GRPC error: %v", err.Error()) + klog.Errorf("GRPC call: %s, GRPC error: %v", info.FullMethod, err.Error()) } else { - klog.V(5).Infof("GRPC response: %+v", resp) + klog.V(5).Infof("GRPC call: %s, GRPC response: %+v", info.FullMethod, resp) } return resp, err }