e632ae8084
Current `auth.log` uses `fullpath` and `ip`, while `api_json.log` uses `remote_ip` and `path` for the same fields. Let's standardize these namings to make it easier for people working with the data. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66167
16 lines
498 B
Ruby
16 lines
498 B
Ruby
# frozen_string_literal: true
|
|
|
|
# This is a fork of
|
|
# https://github.com/aserafin/grape_logging/blob/master/lib/grape_logging/loggers/client_env.rb
|
|
# to use remote_ip instead of ip.
|
|
module Gitlab
|
|
module GrapeLogging
|
|
module Loggers
|
|
class ClientEnvLogger < ::GrapeLogging::Loggers::Base
|
|
def parameters(request, _)
|
|
{ remote_ip: request.env["HTTP_X_FORWARDED_FOR"] || request.env["REMOTE_ADDR"], ua: request.env["HTTP_USER_AGENT"] }
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|