Skip to content

Commit

Permalink
Merge pull request #263 from alphagov/sengi/sentry-logspew
Browse files Browse the repository at this point in the history
Avoid INFO logspew from the Sentry gem.
  • Loading branch information
sengi authored Oct 21, 2022
2 parents e535986 + 12c8ccc commit 7a4f323
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 4.10.0

- Reduce log level for the Sentry gem from `INFO` to `WARN` to avoid polluting logs with uninformative messages. This only affects log messages from the Sentry gem itself, which go to `stdout`.

# 4.9.0

- Add GovukProxy::StaticProxy to forward Static asset requests by setting `GOVUK_PROXY_STATIC_ENABLED=true`.([#261](https://github.com/alphagov/govuk_app_config/pull/261))
Expand Down
2 changes: 2 additions & 0 deletions lib/govuk_app_config/govuk_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def self.configure

Sentry.init do |sentry_config|
config = Configuration.new(sentry_config)
# Avoid "Sending envelope with items ... to Sentry" logspew on stdout.
config.logger.level = Sentry::Logger::WARN
yield config if block_given?
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/govuk_app_config/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module GovukAppConfig
VERSION = "4.9.0".freeze
VERSION = "4.10.0".freeze
end
2 changes: 1 addition & 1 deletion spec/lib/govuk_error_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

it "sends the version along with the request" do
GovukError.notify(StandardError.new, parameters: "Something")
expect(Sentry).to have_received(:capture_exception).with(StandardError.new, hash_including(tags: { govuk_app_config_version: /^[0-9]\.[0-9]\.[0-9](?:\.pre\.[0-9]+)?$/ }))
expect(Sentry).to have_received(:capture_exception).with(StandardError.new, hash_including(tags: { govuk_app_config_version: /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(\.pre\.[0-9]+)?$/ }))
end
end

Expand Down

0 comments on commit 7a4f323

Please sign in to comment.