Implementation of gRPC Logging Middleware, integrating Zerolog as a gRPC Interceptor to log the following fields:
- Request Protobufs as JSON.
- Response Protobufs as JSON, or Errors.
- Status Code, Duration, Timestamp, Service Name, Service Method, IP, Metadata Fields and User Agent.
import (
"github.com/philip-bui/grpc-zerolog"
)
func main() {
grpc.NewServer(
zerolog.UnaryInterceptor(),
)
}
gRPC Zerolog is available under the MIT license. See LICENSE for details.