anz-bank / pkg

Common ANZ Go packages
https://pkg.go.dev/github.com/anz-bank/pkg
Apache License 2.0
2 stars 9 forks source link

Middleware that produces canonical log lines #16

Open jamesrom opened 4 years ago

jamesrom commented 4 years ago

The canonical log line is a lightweight pattern where the key information for a request is logged only once at the end of the request.

Some default values should be added (request method, api version, grpc service method name, etc) and perhaps a simple API to register values in the lifetime of the request?

daemonl commented 4 years ago

Does the generated gRPC code add anything to the context, or otherwise make it easy for us to identify the service / method from the context in a later middleware?

jamesrom commented 4 years ago

Yeah, we can get most of the details in a gRPC interceptor.

I'm not against this being a separate go module (to keep dependencies clean), just raising here for discussion.