sentry-rails 5.27.0 → 5.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sentry/rails/configuration.rb +12 -2
- data/lib/sentry/rails/log_subscriber.rb +5 -2
- data/lib/sentry/rails/railtie.rb +1 -1
- data/lib/sentry/rails/version.rb +1 -1
- data/sentry-rails.gemspec +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bc5fa70737646471ed734ab7db1ccdfb235713916b64698fdcde43d0a6dae42
|
4
|
+
data.tar.gz: 52e0db8ece18a740d682ab4524747473f34ea3e6109d91c585e0ed717531c0e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85298718a87c6a372d2dceb12ca5de499a1d83c618331d3c75b95863c2bf66115ac6fe7311a7e4ec1361d33d0d45a1bed493f9ae5cf6a1964b33e343c36b1192
|
7
|
+
data.tar.gz: 2a496639bf0df1e9f1e5d81a374a63728cc5935e3ac70450e28c1cb06c812e8398dc406169b97ccdd34da5aa747371d09676c1828fe8e0f0e48823edaad26ac0
|
@@ -13,7 +13,7 @@ module Sentry
|
|
13
13
|
class Configuration
|
14
14
|
attr_reader :rails
|
15
15
|
|
16
|
-
|
16
|
+
after(:initialize) do
|
17
17
|
@rails = Sentry::Rails::Configuration.new
|
18
18
|
@excluded_exceptions = @excluded_exceptions.concat(Sentry::Rails::IGNORE_DEFAULT)
|
19
19
|
|
@@ -33,6 +33,10 @@ module Sentry
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
36
|
+
|
37
|
+
after(:configured) do
|
38
|
+
rails.structured_logging.enabled = enable_logs if rails.structured_logging.enabled.nil?
|
39
|
+
end
|
36
40
|
end
|
37
41
|
|
38
42
|
module Rails
|
@@ -202,9 +206,15 @@ module Sentry
|
|
202
206
|
}.freeze
|
203
207
|
|
204
208
|
def initialize
|
205
|
-
@enabled =
|
209
|
+
@enabled = nil
|
206
210
|
@subscribers = DEFAULT_SUBSCRIBERS.dup
|
207
211
|
end
|
212
|
+
|
213
|
+
# Returns true if structured logging should be enabled.
|
214
|
+
# @return [Boolean]
|
215
|
+
def enabled?
|
216
|
+
enabled
|
217
|
+
end
|
208
218
|
end
|
209
219
|
end
|
210
220
|
end
|
@@ -27,6 +27,8 @@ module Sentry
|
|
27
27
|
# end
|
28
28
|
# end
|
29
29
|
class LogSubscriber < ActiveSupport::LogSubscriber
|
30
|
+
ORIGIN = "auto.logger.rails.log_subscriber"
|
31
|
+
|
30
32
|
class << self
|
31
33
|
if ::Rails.version.to_f < 6.0
|
32
34
|
# Rails 5.x does not provide detach_from
|
@@ -51,8 +53,9 @@ module Sentry
|
|
51
53
|
# @param message [String] The log message
|
52
54
|
# @param level [Symbol] The log level (:trace, :debug, :info, :warn, :error, :fatal)
|
53
55
|
# @param attributes [Hash] Additional structured attributes to include
|
54
|
-
|
55
|
-
|
56
|
+
# @param origin [String] The origin of the log event
|
57
|
+
def log_structured_event(message:, level: :info, attributes: {}, origin: ORIGIN)
|
58
|
+
Sentry.logger.public_send(level, message, **attributes, origin: origin)
|
56
59
|
rescue => e
|
57
60
|
# Silently handle any errors in logging to avoid breaking the application
|
58
61
|
Sentry.configuration.sdk_logger.debug("Failed to log structured event: #{e.message}")
|
data/lib/sentry/rails/railtie.rb
CHANGED
@@ -140,7 +140,7 @@ module Sentry
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def activate_structured_logging
|
143
|
-
if Sentry.configuration.rails.structured_logging.enabled && Sentry.configuration.enable_logs
|
143
|
+
if Sentry.configuration.rails.structured_logging.enabled? && Sentry.configuration.enable_logs
|
144
144
|
Sentry::Rails::StructuredLogging.attach(Sentry.configuration.rails.structured_logging)
|
145
145
|
end
|
146
146
|
end
|
data/lib/sentry/rails/version.rb
CHANGED
data/sentry-rails.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentry-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
@@ -29,14 +29,14 @@ dependencies:
|
|
29
29
|
requirements:
|
30
30
|
- - "~>"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 5.
|
32
|
+
version: 5.28.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 5.
|
39
|
+
version: 5.28.0
|
40
40
|
description: A gem that provides Rails integration for the Sentry error logger
|
41
41
|
email: accounts@sentry.io
|
42
42
|
executables: []
|
@@ -92,15 +92,15 @@ files:
|
|
92
92
|
- lib/sentry/rails/tracing/active_support_subscriber.rb
|
93
93
|
- lib/sentry/rails/version.rb
|
94
94
|
- sentry-rails.gemspec
|
95
|
-
homepage: https://github.com/getsentry/sentry-ruby/tree/5.
|
95
|
+
homepage: https://github.com/getsentry/sentry-ruby/tree/5.28.0/sentry-rails
|
96
96
|
licenses:
|
97
97
|
- MIT
|
98
98
|
metadata:
|
99
|
-
homepage_uri: https://github.com/getsentry/sentry-ruby/tree/5.
|
100
|
-
source_code_uri: https://github.com/getsentry/sentry-ruby/tree/5.
|
101
|
-
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/5.
|
99
|
+
homepage_uri: https://github.com/getsentry/sentry-ruby/tree/5.28.0/sentry-rails
|
100
|
+
source_code_uri: https://github.com/getsentry/sentry-ruby/tree/5.28.0/sentry-rails
|
101
|
+
changelog_uri: https://github.com/getsentry/sentry-ruby/blob/5.28.0/CHANGELOG.md
|
102
102
|
bug_tracker_uri: https://github.com/getsentry/sentry-ruby/issues
|
103
|
-
documentation_uri: http://www.rubydoc.info/gems/sentry-rails/5.
|
103
|
+
documentation_uri: http://www.rubydoc.info/gems/sentry-rails/5.28.0
|
104
104
|
rdoc_options: []
|
105
105
|
require_paths:
|
106
106
|
- lib
|