logstasher 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstasher/action_view/log_subscriber.rb +1 -1
- data/lib/logstasher/active_record/log_subscriber.rb +1 -0
- data/lib/logstasher/active_support/log_subscriber.rb +2 -1
- data/lib/logstasher/rails_ext/action_controller/metal/instrumentation.rb +0 -1
- data/lib/logstasher/version.rb +1 -1
- data/lib/logstasher.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a145ef20aa7c10ed9477b6e6bebd87234165f75f
|
4
|
+
data.tar.gz: bc3b6bad147c07d139589a5571cc91207fd6bf4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fce09c9c21ccb9557f4cd3de6dd159f39fd20613c3d5b2720fa103aa36dc85772bb8ca8bd0e212cec7f73036744487780089afb96a2eaaab090609356cf9e443
|
7
|
+
data.tar.gz: d23b01e0585845e2cadb57dc01adbf74839c00ef25372a93a9b462b8cdf2721f6d2b09e7fc3d992492597c9088a9814013b42b376013c7c5657dccb319b22dda
|
@@ -15,6 +15,7 @@ module LogStasher
|
|
15
15
|
data.merge! runtimes(event)
|
16
16
|
data.merge! location(event)
|
17
17
|
data.merge! extract_exception(payload)
|
18
|
+
data.merge! LogStasher.store
|
18
19
|
data.merge! extract_custom_fields(payload)
|
19
20
|
|
20
21
|
tags = ['request']
|
@@ -86,7 +87,7 @@ module LogStasher
|
|
86
87
|
def extract_exception(payload)
|
87
88
|
if payload[:exception]
|
88
89
|
exception, message = payload[:exception]
|
89
|
-
status = ActionDispatch::ExceptionWrapper.status_code_for_exception(exception)
|
90
|
+
status = ::ActionDispatch::ExceptionWrapper.status_code_for_exception(exception)
|
90
91
|
if LogStasher.backtrace
|
91
92
|
backtrace = $!.backtrace.join("\n")
|
92
93
|
else
|
data/lib/logstasher/version.rb
CHANGED
data/lib/logstasher.rb
CHANGED
@@ -17,7 +17,7 @@ module LogStasher
|
|
17
17
|
REQUEST_CONTEXT_KEY = :logstasher_request_context
|
18
18
|
|
19
19
|
attr_accessor :logger, :logger_path, :enabled, :log_controller_parameters, :source, :backtrace,
|
20
|
-
:controller_monkey_patch
|
20
|
+
:controller_monkey_patch, :field_renaming
|
21
21
|
# Setting the default to 'unknown' to define the default behaviour
|
22
22
|
@source = 'unknown'
|
23
23
|
# By default log the backtrace of exceptions
|
@@ -112,6 +112,7 @@ module LogStasher
|
|
112
112
|
self.backtrace = !! config.backtrace unless config.backtrace.nil?
|
113
113
|
self.set_data_for_rake
|
114
114
|
self.set_data_for_console
|
115
|
+
self.field_renaming = Hash(config.field_renaming)
|
115
116
|
end
|
116
117
|
|
117
118
|
def set_data_for_rake
|
@@ -177,6 +178,9 @@ module LogStasher
|
|
177
178
|
end
|
178
179
|
|
179
180
|
def build_logstash_event(data, tags)
|
181
|
+
field_renaming.each do |old_name, new_name|
|
182
|
+
data[new_name] = data.delete(old_name) if data.key?(old_name)
|
183
|
+
end
|
180
184
|
::LogStash::Event.new(data.merge('source' => self.source, 'tags' => tags))
|
181
185
|
end
|
182
186
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstasher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shadab Ahmed
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-event
|