From 70b80aabcef0a10ed632ec1002a2899722bb9257 Mon Sep 17 00:00:00 2001 From: Intizar Date: Wed, 17 Jul 2024 11:48:02 +0900 Subject: [PATCH] add ctx logs to dal middleware --- node/pkg/dal/utils/stats/stats.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node/pkg/dal/utils/stats/stats.go b/node/pkg/dal/utils/stats/stats.go index 43b4a6d89..3e3e6dde9 100644 --- a/node/pkg/dal/utils/stats/stats.go +++ b/node/pkg/dal/utils/stats/stats.go @@ -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]