Skip to content

Commit

Permalink
util: remove separate logging for Replication
Browse files Browse the repository at this point in the history
as the replication is moved to the new RPC
server, removing its logging steps from the
main cephcsi server logging.

Signed-off-by: Madhu Rajanna <[email protected]>
  • Loading branch information
Madhu-1 committed Nov 3, 2023
1 parent 5637eca commit 9609663
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions internal/csi-common/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/ceph/ceph-csi/internal/util/log"

"github.com/container-storage-interface/spec/lib/go/csi"
rp "github.com/csi-addons/replication-lib-utils/protosanitizer"
"github.com/csi-addons/spec/lib/go/replication"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
Expand Down Expand Up @@ -193,18 +192,7 @@ func logGRPC(
handler grpc.UnaryHandler,
) (interface{}, error) {
log.ExtendedLog(ctx, "GRPC call: %s", info.FullMethod)
// TODO: remove the following check for next release
// refer to https://github.com/ceph/ceph-csi/issues/3314.
if isReplicationRequest(req) {
strippedMessage := protosanitizer.StripSecrets(req).String()
if !strings.Contains(strippedMessage, "***stripped***") {
strippedMessage = rp.StripReplicationSecrets(req).String()
}

log.TraceLog(ctx, "GRPC request: %s", strippedMessage)
} else {
log.TraceLog(ctx, "GRPC request: %s", protosanitizer.StripSecrets(req))
}
log.TraceLog(ctx, "GRPC request: %s", protosanitizer.StripSecrets(req))
resp, err := handler(ctx, req)
if err != nil {
klog.Errorf(log.Log(ctx, "GRPC error: %v"), err)
Expand Down

0 comments on commit 9609663

Please sign in to comment.