[baseserver] do not log grpc messages unless they contain an error

This commit is contained in:
Pavel Tumik 2022-07-14 19:14:52 +00:00 committed by Robo Quat
parent 95ec04a005
commit dc94adbbee

View File

@ -269,6 +269,10 @@ func (s *Server) initializeGRPC() error {
unary := []grpc.UnaryServerInterceptor{
grpc_logrus.UnaryServerInterceptor(s.Logger(),
grpc_logrus.WithDecider(func(fullMethodName string, err error) bool {
// Skip logs for anything that does not contain an error.
if err == nil {
return false
}
// Skip gRPC healthcheck logs, they are frequent and pollute our logging infra
return fullMethodName != "/grpc.health.v1.Health/Check"
}),