Class: Gitlab::GrapeLogging::Loggers::ContextLogger

Inherits:
GrapeLogging::Loggers::Base
  • Object
show all
Defined in:
lib/gitlab/grape_logging/loggers/context_logger.rb

Instance Method Summary collapse

Instance Method Details

#parameters(request, _) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/gitlab/grape_logging/loggers/context_logger.rb', line 8

def parameters(request, _)
  # Add remote_ip if this request wasn't already handled. If we
  # add it unconditionally we can break client_id due to the way
  # the context inherits the user.
  unless Gitlab::ApplicationContext.current_context_include?(:remote_ip)
    Gitlab::ApplicationContext.push(remote_ip: request.ip)
  end

  Gitlab::ApplicationContext.current
end