4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/amqp_logging/metrics_agent/rails/after_dispatch_callback_handler.rb', line 4
def self.run(dispatcher)
env = dispatcher.instance_variable_get(:@env)
response = env["action_controller.rescue.response"]
request = env["action_controller.rescue.request"]
= request..dup
.each do |k, v|
case v
when String, Fixnum, Numeric
else
[k] = "#<#{v.class.name}>"
end
end
agent = ActionController::Base.logger.agent
agent.fields.merge!({
:env => RAILS_ENV,
:response_code => response.status,
:request_params => request.request_parameters,
:request_headers => ,
:response_headers => response.
})
agent.flush
end
|