teamhanko / hanko

Authentication and user management for the passkey era.
https://hanko.io
Other
5.67k stars 794 forks source link

add flow api logging #1519

Closed FreddyDevelop closed 1 month ago

FreddyDevelop commented 1 month ago

Description

Uses zerolog to log requests to the flow API. The logging middleware from echo could be used but an error from the flow API would not be logged. Thats because the handler function would need to return an error in order to be logged by the middleware, but the flow API handler does not return an error. So the handler logs the requests itself with zerolog.

TODO

The logs from the flow API handler and from the middleware should log the same values. Currently the middleware logs more values that the flow API handler. We should check which values are needed and which we can remove.

bjoern-m commented 1 month ago

Shall we remove the line c.Logger().Errorf("failed to handle the request: %v", err) in backend/flow_api/handler.go: Line 90?

FreddyDevelop commented 1 month ago

Oh, yes we don't need that anymore.