go-grpc-middleware icon indicating copy to clipboard operation
go-grpc-middleware copied to clipboard

Add factory based zap payload logging interceptor

Open deepakgupta33 opened this issue 3 years ago • 2 comments

Feature Request: We have a use case to extract key-value pairs from the context for the payload logging.

Current state: The context sent by the grpc framework to the interceptor but there is no hook for payload interceptor user to plug into and be able to decorate the logger with the information in the context object. There are other interceptors which populate the context object.

Solution: Instead of directly passing on the logger, we create another method that accepts a logger factory. The logger is created only after the context is received with the context object.

deepakgupta33 avatar Nov 03 '21 07:11 deepakgupta33

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] avatar Nov 03 '21 07:11 google-cla[bot]

@googlebot signed it!

deepakgupta33 avatar Nov 03 '21 08:11 deepakgupta33