grpc-ecosystem / go-grpc-middleware

Golang gRPC Middlewares: interceptor chaining, auth, logging, retries and more.
Apache License 2.0
6.26k stars 690 forks source link

Configurable key and value for time-related logging interceptor fields #406

Open bow opened 3 years ago

bow commented 3 years ago

Hi maintainers

Are there are any plans on exposing time-related logging fields (such as this one, that adds the current time) so that library users can modify them? In this particular example, that could mean modifying the string key, or generating the timestamp in UTC instead of local time.

After trawling through the issues and current merge requests, I do see #399 and #398 which seem related. I am however interested in taking the generalization a little further: not just the formatting, but the time value itself as well as the key name. I'd be happy to help if needed ~ it'd be great to see this in v2 :).

johanbrandhorst commented 3 years ago

I have to push back a little bit here - is there any reason you don't just use your own interceptor function if you want to use a custom time value and format? Too much configuration will also make this library unusable.