gRPC Zerolog
![GoDoc Widget](https://godoc.org/github.com/philip-bui/grpc-zerolog?status.svg)
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.
Usage
import (
"github.com/philip-bui/grpc-zerolog"
)
func main() {
grpc.NewServer(
zerolog.UnaryInterceptor(),
)
log := zerolog.New(os.Stdout)
grpc.NewServer(
zerolog.UnaryInterceptorWithLogger(&log),
)
}
License
gRPC Zerolog is available under the MIT license. See LICENSE for details.