Changed remote_addr to use X-Forwarded-For header
This commit is contained in:
@@ -44,7 +44,7 @@ func Logging(logger *zerolog.Logger, next http.Handler) http.Handler {
|
|||||||
Str("method", r.Method).
|
Str("method", r.Method).
|
||||||
Str("resource", r.URL.Path).
|
Str("resource", r.URL.Path).
|
||||||
Dur("time_elapsed", time.Since(start)).
|
Dur("time_elapsed", time.Since(start)).
|
||||||
Str("remote_addr", r.RemoteAddr).
|
Str("remote_addr", r.Header.Get("X-Forwarded-For")).
|
||||||
Msg("Served")
|
Msg("Served")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user