Skip to content

Commit

Permalink
Use x_forwarded_for logger key instead of real_ip
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepeterson committed Apr 4, 2022
1 parent 3713821 commit 80a07d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TraceLoggingMiddleware(next http.Handler, logger log.Logger, newTrace func(
}

if fwdedFor := r.Header.Get("X-Forwarded-For"); fwdedFor != "" {
logs = append(logs, "real_ip", fwdedFor)
logs = append(logs, "x_forwarded_for", fwdedFor)
}

ctxlog.Logger(ctx, logger).Info(logs...)
Expand Down

0 comments on commit 80a07d3

Please sign in to comment.