Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/philip-bui/grpc-zerolog

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/philip-bui/grpc-zerolog

  • v1.0.1
  • Source
  • Go
  • Socket score

Version published
Created
Source

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() {
	// With global Zerolog logger.
	grpc.NewServer(
		zerolog.UnaryInterceptor(),
	)

	// With custom Zerolog instance.
	log := zerolog.New(os.Stdout)
	grpc.NewServer(
		zerolog.UnaryInterceptorWithLogger(&log),
	)
}

License

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

FAQs

Package last updated on 05 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc