Skip to content

gRPC Middleware to log requests and responses using Zerolog.

License

Notifications You must be signed in to change notification settings

schmizz/grpc-zerolog

 
 

Repository files navigation

gRPC Zerolog

BuildStatus Widget CodeCov Widget GoReport Widget GoDoc Widget

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(),
	)
}

License

gRPC Zerolog is available under the MIT license. See LICENSE for details.

About

gRPC Middleware to log requests and responses using Zerolog.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 98.4%
  • Makefile 1.6%