heavylog 0.0.21 → 0.0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/heavylog/formatters/ecs.rb +3 -1
- data/lib/heavylog/log_subscriber.rb +10 -4
- data/lib/heavylog/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97686d14f27208a6334ce6c76a20d11562fdbe2affdb5d3794b7baae2620c6c6
|
4
|
+
data.tar.gz: fee3b90c91fe906b10bcb7b4b109d90b328a166925b9fe4d82e7459089e6e593
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b2949b2eb311aed8c768b8d4f1cf259c843d5efe2a200dfce835da0e87752f736a3a26e2cdb5853a7428178ba524e9af22260b9459de97ba09de95e5e4d0d0e
|
7
|
+
data.tar.gz: 8a492bc19d4b02ca5d3fb0ea9fff617cd556eb5a328f6e6cd8f8a573f12630463cb9a66e6c5570d7bf7b2aa3adc91ece833094a777434bea4205d9cbc389dd40
|
data/Gemfile.lock
CHANGED
@@ -16,7 +16,9 @@ module Heavylog
|
|
16
16
|
"status" => "http.response.status_code",
|
17
17
|
"location" => "http.response.location",
|
18
18
|
"ip" => "source.address",
|
19
|
+
"host" => "url.domain",
|
19
20
|
"path" => "url.original",
|
21
|
+
"user_agent" => "user_agent.original",
|
20
22
|
"controller" => "heavylog.controller",
|
21
23
|
"action" => "heavylog.action",
|
22
24
|
"unpermitted_params" => "heavylog.unpermitted_params",
|
@@ -28,7 +30,7 @@ module Heavylog
|
|
28
30
|
|
29
31
|
def call(data)
|
30
32
|
ECS_MAP.each do |original, correct|
|
31
|
-
dig_set(data, correct.split("."), data.delete(original)) if data
|
33
|
+
dig_set(data, correct.split("."), data.delete(original)) if data.key?(original)
|
32
34
|
end
|
33
35
|
|
34
36
|
dig_set(data, %w[event module], "heavylog")
|
@@ -31,7 +31,7 @@ module Heavylog
|
|
31
31
|
data.merge!(extract_runtimes(event, payload))
|
32
32
|
data.merge!(extract_location)
|
33
33
|
data.merge!(extract_unpermitted_params)
|
34
|
-
data.merge!(
|
34
|
+
data.merge!(extract_request_data(payload))
|
35
35
|
data.merge!(custom_options(event))
|
36
36
|
end
|
37
37
|
|
@@ -103,9 +103,15 @@ module Heavylog
|
|
103
103
|
{ unpermitted_params: unpermitted_params }
|
104
104
|
end
|
105
105
|
|
106
|
-
def
|
107
|
-
if payload[:request].is_a?(ActionDispatch::Request)
|
108
|
-
|
106
|
+
def extract_request_data(payload)
|
107
|
+
if payload[:request].is_a?(ActionDispatch::Request)
|
108
|
+
data = {}
|
109
|
+
|
110
|
+
data[:referrer] = payload[:request].referrer if payload[:request].referrer
|
111
|
+
data[:host] = payload[:request].host
|
112
|
+
data[:user_agent] = payload[:request].user_agent
|
113
|
+
|
114
|
+
return data
|
109
115
|
end
|
110
116
|
|
111
117
|
{}
|
data/lib/heavylog/version.rb
CHANGED