Skip to content

Commit 013857e

Browse files
committed
Request id in reporter middleware
Signed-off-by: Vishal Rana <[email protected]>
1 parent 4765db7 commit 013857e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

reporter/reporter.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,12 @@ func MiddlewareWithConfig(config Config) echo.MiddlewareFunc {
108108

109109
func appendFields(f labstack.Fields, c echo.Context, config Config) {
110110
f.
111+
Add("id", labstack.RequestID(c.Request(), c.Response())).
111112
Add("host", c.Request().Host).
112113
Add("path", c.Request().URL.Path).
113114
Add("method", c.Request().Method).
114-
Add("client_id", c.RealIP()).
115-
Add("remote_ip", c.RealIP()).
115+
Add("client_id", labstack.RealIP(c.Request())).
116+
Add("remote_ip", labstack.RealIP(c.Request())).
116117
Add("status", c.Response().Status)
117118
for _, h := range config.Headers {
118119
f.Add("header_"+h, c.Request().Header.Get(h))

0 commit comments

Comments
 (0)