From f9cb0a2de1d7ed64aa04f74f4209f117ea60186f Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 4 Mar 2026 23:35:34 +0100 Subject: [PATCH] fix: include remote IP address in HTTP request logs --- pkg/routes/routes.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/routes/routes.go b/pkg/routes/routes.go index d6bc1e8a3..d47e61abe 100644 --- a/pkg/routes/routes.go +++ b/pkg/routes/routes.go @@ -135,10 +135,12 @@ func NewEcho() *echo.Echo { LogURI: true, LogMethod: true, LogLatency: true, + LogRemoteIP: true, HandleError: true, LogValuesFunc: func(_ *echo.Context, v middleware.RequestLoggerValues) error { if v.Error == nil { httpLogger.LogAttrs(context.Background(), slog.LevelInfo, "", + slog.String("remote_ip", v.RemoteIP), slog.String("method", v.Method), slog.String("uri", v.URI), slog.Int("status", v.Status), @@ -146,6 +148,7 @@ func NewEcho() *echo.Echo { ) } else { httpLogger.LogAttrs(context.Background(), slog.LevelError, "", + slog.String("remote_ip", v.RemoteIP), slog.String("method", v.Method), slog.String("uri", v.URI), slog.Int("status", v.Status),