Skip to content

Commit

Permalink
add ctx logs to dal middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Intizar-T committed Jul 17, 2024
1 parent c7a61ab commit 70b80aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion node/pkg/dal/utils/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ func StatsMiddleware(c *fiber.Ctx) error {
headers := c.GetReqHeaders()
apiKeyRaw, ok := headers["X-Api-Key"]
if !ok {
log.Warn().Msg("X-Api-Key header not found")
log.Warn().Str("ip", c.IP()).
Str("method", c.Method()).
Str("path", c.Path()).Msg("X-Api-Key header not found")
return nil
}
apiKey := apiKeyRaw[0]
Expand Down

0 comments on commit 70b80aa

Please sign in to comment.