An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 3.6% on proxy.golang.org
Top 1.0% forks on proxy.golang.org

proxy.golang.org : github.com/grpc-ecosystem/go-grpc-middleware/logging/zap

`grpc_zap` is a gRPC logging middleware backed by ZAP loggers It accepts a user-configured `zap.Logger` that will be used for logging completed gRPC calls. The same `zap.Logger` will be used for logging completed gRPC calls, and be populated into the `context.Context` passed into gRPC handler code. On calling `StreamServerInterceptor` or `UnaryServerInterceptor` this logging middleware will add gRPC call information to the ctx so that it will be present on subsequent use of the `ctx_zap` logger. If a deadline is present on the gRPC request the grpc.request.deadline tag is populated when the request begins. grpc.request.deadline is a string representing the time (RFC3339) when the current call will expire. This package also implements request and response *payload* logging, both for server-side and client-side. These will be logged as structured `jsonpb` fields for every message received/sent (both unary and streaming). For that please use `Payload*Interceptor` functions for that. Please note that the user-provided function that determines whether to log the full request/response payload needs to be written with care, this can significantly slow down gRPC. ZAP can also be made as a backend for gRPC library internals. For that use `ReplaceGrpcLoggerV2`. *Server Interceptor* Below is a JSON formatted example of a log that would be logged by the server interceptor: *Payload Interceptor* Below is a JSON formatted example of a log that would be logged by the payload interceptor: Note - due to implementation ZAP differs from Logrus in the "grpc.request.content" object by having an inner "msg" object. Please see examples and tests for examples of use. Please see settable_test.go for canonical integration through "zaptest" with golang testing infrastructure. Initialization shows a relatively complex initialization sequence. Initialization shows an initialization sequence with the duration field generation overridden.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/grpc-ecosystem/go-grpc-middleware/logging/zap
Keywords: authentication , generic-functions , golang , grpc , interceptor , library , logging , middleware , retries , testing
License: Apache-2.0
Latest release: 24 days ago
Namespace: github.com/grpc-ecosystem/go-grpc-middleware/logging
Stars: 6,258 on GitHub
Forks: 690 on GitHub
Total Commits: 297
Committers: 124
Average commits per author: 2.395
Development Distribution Score (DDS): 0.758
More commit stats: commits.ecosyste.ms
See more repository details: repos.ecosyste.ms
Last synced: 24 days ago