Skip to content

Commit ffbcd84

Browse files
committed
fix(api): use skipPaths
Signed-off-by: Ales Verbic <[email protected]>
1 parent 3b702de commit ffbcd84

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/api/api.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ func Start(cfg *config.Config) error {
7171
logger.Info("disabling access logs for /healthcheck")
7272
}
7373
accessMiddleware := func(c *gin.Context) {
74+
// Skip logging for specified paths
75+
for _, path := range skipPaths {
76+
if c.Request.URL.Path == path {
77+
c.Next()
78+
return
79+
}
80+
}
7481
accessLogger.Info("request received", "method", c.Request.Method, "path", c.Request.URL.Path, "remote_addr", c.ClientIP())
7582
c.Next()
7683
statusCode := c.Writer.Status()

0 commit comments

Comments
 (0)