rack-action_logger 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dec94c5c2fd33a145340642bbffd9b28d6f288b2
|
4
|
+
data.tar.gz: 70bb26af081824cb9d3dc255fbe4da00be698c4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e25b9f8999e7e77f0ecb5f685f6ab6ee24a8bc65279116fb4b41d6bb3fe80718075ed3938c64f6b3b7cae6237bb3058db3d48db6a505a777436e413324a5e99
|
7
|
+
data.tar.gz: 5c946fec0a87b1e89180cb0dddf5c394ce5d0225f1760c28351d22527b0cda91396eb9e6c8a6f1b53181b437290e9e551b9f15db4a74cf04a1e4852ae4b98bcd
|
data/Gemfile.lock
CHANGED
@@ -15,6 +15,7 @@ module Rack::ActionLogger
|
|
15
15
|
|
16
16
|
def capture_rack_log(env, status_code, headers, body)
|
17
17
|
rack_metrics = Rack::ActionLogger.configuration.rack_metrics.new(env, status_code, headers, body)
|
18
|
+
return if rack_metrics.metrics.nil?
|
18
19
|
Rack::ActionLogger::Container.set_request_log(rack_metrics.metrics, rack_metrics.tag_suffix)
|
19
20
|
Rack::ActionLogger::Container.merge_attributes({ request_id: rack_metrics.request_id })
|
20
21
|
end
|
@@ -9,6 +9,7 @@ module Rack::ActionLogger::Metrics
|
|
9
9
|
:browser_version, :request_id, :response_headers, :response_json_body,
|
10
10
|
]
|
11
11
|
RACK_TAG_PREFIX = 'rack'
|
12
|
+
EXCLUDE_PATH_PREFIX = '/asset'
|
12
13
|
|
13
14
|
attr_reader :status_code
|
14
15
|
|
@@ -33,6 +34,7 @@ module Rack::ActionLogger::Metrics
|
|
33
34
|
end
|
34
35
|
|
35
36
|
def metrics
|
37
|
+
return unless action_controller
|
36
38
|
METRICS.inject({}) do |result, metric|
|
37
39
|
result[metric] = self.send(metric) unless
|
38
40
|
Rack::ActionLogger.configuration.rack_request_blacklist.include? metric
|
@@ -56,6 +58,10 @@ module Rack::ActionLogger::Metrics
|
|
56
58
|
@env.select { |v| v.start_with? 'HTTP_' }
|
57
59
|
end
|
58
60
|
|
61
|
+
def action_controller
|
62
|
+
@env['action_controller.instance']
|
63
|
+
end
|
64
|
+
|
59
65
|
def remote_ip
|
60
66
|
@request.ip
|
61
67
|
end
|