logstasher 2.1.2 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstasher.rb +2 -1
- data/lib/logstasher/active_support/log_subscriber.rb +8 -4
- data/lib/logstasher/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: 59cdc11b4f36e90443fcc8ea7332552874da2ad2205f38e4efac48c8e4dda63a
|
4
|
+
data.tar.gz: 997cb22cb6799f67d28562e986e326fa23597ee5168a635bdc917d6a9bb65c6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd6d94a4055566fd119a570107724ce1fc1c1f3f1781f2929c248e4f2b227a3f95adb010b6e059f44cf49991f5baa1d9f3271f272efb5a97415104a265eb0e1b
|
7
|
+
data.tar.gz: 35d3e80b5e460753033b327e41d51149d24b20c7b1321189a2ec24373ac5aa9c713189eba701ddc3ec5904fbf86a2b98657deff4c2a02fcfcee20f93c31fd9f9
|
data/lib/logstasher.rb
CHANGED
@@ -20,7 +20,7 @@ module LogStasher
|
|
20
20
|
REQUEST_CONTEXT_KEY = :logstasher_request_context
|
21
21
|
|
22
22
|
attr_accessor :logger, :logger_path, :enabled, :log_controller_parameters, :source, :backtrace,
|
23
|
-
:controller_monkey_patch, :field_renaming
|
23
|
+
:controller_monkey_patch, :field_renaming, :backtrace_filter
|
24
24
|
|
25
25
|
# Setting the default to 'unknown' to define the default behaviour
|
26
26
|
@source = 'unknown'
|
@@ -113,6 +113,7 @@ module LogStasher
|
|
113
113
|
self.source = config.source unless config.source.nil?
|
114
114
|
self.log_controller_parameters = !config.log_controller_parameters.nil?
|
115
115
|
self.backtrace = !config.backtrace.nil? unless config.backtrace.nil?
|
116
|
+
self.backtrace_filter = config.backtrace_filter
|
116
117
|
set_data_for_rake
|
117
118
|
set_data_for_console
|
118
119
|
self.field_renaming = Hash(config.field_renaming)
|
@@ -86,10 +86,14 @@ module LogStasher
|
|
86
86
|
exception, message = payload[:exception]
|
87
87
|
status = ::ActionDispatch::ExceptionWrapper.status_code_for_exception(exception)
|
88
88
|
backtrace = if LogStasher.backtrace
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
89
|
+
if LogStasher.backtrace_filter.respond_to?(:call)
|
90
|
+
LogStasher.backtrace_filter.call($!.backtrace).join("\n")
|
91
|
+
else
|
92
|
+
$!.backtrace.join("\n")
|
93
|
+
end
|
94
|
+
else
|
95
|
+
$!.backtrace.first
|
96
|
+
end
|
93
97
|
message = "#{exception}\n#{message}\n#{backtrace}"
|
94
98
|
{ status: status, error: message }
|
95
99
|
else
|
data/lib/logstasher/version.rb
CHANGED