Skip to content

Commit

Permalink
feat(server.go): log request details when requestId is present
Browse files Browse the repository at this point in the history
  • Loading branch information
chronark committed Aug 6, 2024
1 parent 06902de commit c09b217
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/agent/pkg/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ func New(config Config) *Server {
defer span.End()

requestId := hCtx.Header("Unkey-Request-Id")
if requestId != "" {
s.logger.Info().Str("requestId", requestId).Str("method", hCtx.Method()).Str("path", hCtx.URL().Path).Int("status", hCtx.Status()).Msg("request started")
}

hCtx.AppendHeader("x-node-id", config.NodeId)

Expand Down

0 comments on commit c09b217

Please sign in to comment.