Extract zap logger from context for logging server interceptors#476
Extract zap logger from context for logging server interceptors#476implmnt wants to merge 1 commit into
Conversation
|
Hi Georgy. I'm not sure this is a change we want to make, could you explain the rationale for this new API? Please note that we have moved all new feature development to the v2 branch too, where we have a new structure for these sort of implementations. |
|
Hi Johan. Thanks for notifying me about v2 branch. Will check it too. The reason of the new API is making possible to reuse logger that was inited in some before step. For expample: So I think it would be better to have a more flexible API that allows extracting logger from request context with some predefined fields like |
|
@bwplotka do you have any thoughts on this? |
|
Sorry for lag! Yes, while this is great, we have opportunity to change things on |
This PR extends the current zap logging server interceptors API.
It makes possible to reuse existing logger from GRPC request context for logging user's contextual data (e.g. the
user_idthat was shifted before into the logging context).