-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2: logging injected fields not in postcall log #570
Comments
I'm noticing the same just using the example logrus logger, no fields being added, even with all the logging.Options configured. |
The examples are wrong. They aren't iterating over the iterator. instead of
it should be:
|
Fixes grpc-ecosystem#570 Signed-off-by: Chance Zibolski <[email protected]>
* interceptors: Fix logrus example to iterate over all fields Fixes #570 Signed-off-by: Chance Zibolski <[email protected]> * interceptors: Update zap InterceptorLogger to use Iterator properly The logic in the example is redundant with the logging.Fields Iterator Signed-off-by: Chance Zibolski <[email protected]> --------- Signed-off-by: Chance Zibolski <[email protected]>
* interceptors: Fix logrus example to iterate over all fields Fixes grpc-ecosystem#570 Signed-off-by: Chance Zibolski <[email protected]> * interceptors: Update zap InterceptorLogger to use Iterator properly The logic in the example is redundant with the logging.Fields Iterator Signed-off-by: Chance Zibolski <[email protected]> --------- Signed-off-by: Chance Zibolski <[email protected]>
I'm also seeing the same with the zerolog example when using InjectFields to inject the subject from my JWT in my authentication interceptor function. I can print the value fine via ExtractFields, but it's not output from the FinishCall event. |
It seems that when injecting fields the fields are not in, e.g.,
PostCall
, logs.The reproduction for this seems to simply use
InjectFields
on a context and pass it on. The fields are in thenewCtx
but no the "original"ctx
in theserver.go
.Am I using
InjectFields
wrong or am I missing something else?The text was updated successfully, but these errors were encountered: