Skip to content

Commit

Permalink
Merge pull request #264 from alphagov/sengi/fix-loglevel
Browse files Browse the repository at this point in the history
Fix an ownership bug when configuring the Sentry logger.
  • Loading branch information
sengi authored Oct 24, 2022
2 parents 7a4f323 + 180f566 commit 28fe97e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 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.1

- Fix an object ownership/sharing bug where the Rails log level was erroneously being set to `WARN` when initialising Sentry.

# 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`.
Expand Down
2 changes: 0 additions & 2 deletions lib/govuk_app_config/govuk_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ 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
4 changes: 4 additions & 0 deletions lib/govuk_app_config/govuk_error/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ def set_up_defaults
"GdsApi::ContentStore::ItemNotFound",
]

# Avoid "Sending envelope with items ... to Sentry" logspew, since we
# don't use Sentry's automatic session tracking.
self.auto_session_tracking = false

@before_send_callbacks = [
ignore_excluded_exceptions_in_data_sync,
increment_govuk_statsd_counters,
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.10.0".freeze
VERSION = "4.10.1".freeze
end

0 comments on commit 28fe97e

Please sign in to comment.