sapience 2.6.1 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/lib/sapience/configuration.rb +4 -2
- data/lib/sapience/extensions/grape/middleware/logging.rb +1 -3
- data/lib/sapience/log.rb +2 -1
- data/lib/sapience/logger.rb +1 -0
- data/lib/sapience/rails/engine.rb +3 -1
- data/lib/sapience/version.rb +1 -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: b73285e98f5fc0d1a47770f8a9aaa46ca9cdb392
|
4
|
+
data.tar.gz: 06904793b69382fff48e1cfdd8deaaa8b277f682
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e97abc320690cbea9cbb02a8658ddaa4391f350c665b11122ce8a4b432d84c3def3b808b1ac2460447d96b6fd980e243f9342a749227145802918b7e54c9e30b
|
7
|
+
data.tar.gz: 8704dd5f928835b063eeb2fbd9fa24780cff06a6736db54335085acc4c056502d7ff8fb06810044b02f91140593c61337caa79a8578e18b9c89019fe02a9850c
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
## v2.7.0
|
2
|
+
- Add ability to stop generating metrics for ActiveRecord::Notification with config option `silent_active_record`
|
3
|
+
|
4
|
+
## v2.6.4
|
5
|
+
- Bugfix: don't auto-add tags for every application level exception
|
6
|
+
|
7
|
+
## v2.6.3
|
8
|
+
- Include current environment in log entries
|
9
|
+
|
10
|
+
## v2.6.2
|
11
|
+
- Bugfix: clear tags after pushing log to processing queue
|
12
|
+
|
13
|
+
## v2.6.1
|
14
|
+
- Bugfix: Fix sentry logging when payload is nil
|
15
|
+
|
1
16
|
## v2.6.0
|
2
17
|
|
3
18
|
- Add ability to reduce noise from default rails log subscribers with config option `silent_rails`
|
@@ -8,7 +8,7 @@ module Sapience
|
|
8
8
|
attr_reader :default_level, :backtrace_level, :backtrace_level_index
|
9
9
|
attr_writer :host
|
10
10
|
attr_accessor :app_name, :ap_options, :appenders, :log_executor, :filter_parameters,
|
11
|
-
:metrics, :error_handler, :silent_rails
|
11
|
+
:metrics, :error_handler, :silent_active_record, :silent_rails
|
12
12
|
|
13
13
|
SUPPORTED_EXECUTORS = %i(single_thread_executor immediate_executor).freeze
|
14
14
|
DEFAULT = {
|
@@ -20,6 +20,7 @@ module Sapience
|
|
20
20
|
metrics: { datadog: { url: Sapience::DEFAULT_STATSD_URL } },
|
21
21
|
error_handler: { silent: {} },
|
22
22
|
filter_parameters: %w(password password_confirmation),
|
23
|
+
silent_active_record: false,
|
23
24
|
silent_rails: false,
|
24
25
|
}.freeze
|
25
26
|
|
@@ -39,7 +40,8 @@ module Sapience
|
|
39
40
|
self.filter_parameters = @options[:filter_parameters]
|
40
41
|
self.metrics = @options[:metrics]
|
41
42
|
self.error_handler = @options[:error_handler]
|
42
|
-
self.
|
43
|
+
self.silent_active_record = @options[:silent_active_record]
|
44
|
+
self.silent_rails = @options[:silent_rails]
|
43
45
|
end
|
44
46
|
|
45
47
|
# Sets the global default log level
|
@@ -55,14 +55,12 @@ module Sapience
|
|
55
55
|
@logger.info(parameters)
|
56
56
|
end
|
57
57
|
|
58
|
-
def after_exception(exc)
|
59
|
-
Sapience.push_tags(exc.class.name, exc.message)
|
58
|
+
def after_exception(exc) # rubocop:disable Lint/UnusedMethodArgument
|
60
59
|
@status = 500
|
61
60
|
after
|
62
61
|
end
|
63
62
|
|
64
63
|
def after_failure(error)
|
65
|
-
Sapience.push_tags(error[:message])
|
66
64
|
@status = error[:status]
|
67
65
|
after
|
68
66
|
end
|
data/lib/sapience/log.rb
CHANGED
@@ -172,7 +172,7 @@ module Sapience
|
|
172
172
|
end
|
173
173
|
|
174
174
|
# Returns [Hash] representation of this log entry
|
175
|
-
def to_h(host = Sapience.config.host, app_name = Sapience.app_name) # rubocop:disable AbcSize, CyclomaticComplexity, PerceivedComplexity, LineLength
|
175
|
+
def to_h(host = Sapience.config.host, app_name = Sapience.app_name, environment = Sapience.environment) # rubocop:disable AbcSize, CyclomaticComplexity, PerceivedComplexity, LineLength
|
176
176
|
# Header
|
177
177
|
h = {
|
178
178
|
name: name,
|
@@ -181,6 +181,7 @@ module Sapience
|
|
181
181
|
time: time,
|
182
182
|
level: level,
|
183
183
|
level_index: level_index,
|
184
|
+
environment: environment,
|
184
185
|
}
|
185
186
|
h[:host] = host if host
|
186
187
|
h[:app_name] = app_name if app_name
|
data/lib/sapience/logger.rb
CHANGED
@@ -78,7 +78,9 @@ module Sapience
|
|
78
78
|
|
79
79
|
Sapience::Extensions::ActionController::LogSubscriber.attach_to :action_controller
|
80
80
|
# Sapience::Extensions::ActiveSupport::MailerLogSubscriber.attach_to :action_mailer
|
81
|
-
|
81
|
+
if defined?(ActiveRecord) && !Sapience.config.silent_active_record
|
82
|
+
Sapience::Extensions::ActiveRecord::Notifications.use
|
83
|
+
end
|
82
84
|
Sapience::Extensions::ActionView::LogSubscriber.attach_to :action_view
|
83
85
|
# Sapience::Extensions::ActiveJob::LogSubscriber.attach_to :active_job
|
84
86
|
Sapience::Extensions::ActionController::Notifications.use
|
data/lib/sapience/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sapience
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikael Henriksson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-12-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: concurrent-ruby
|