Skip to content

Commit

Permalink
Log envelope delivery message with debug instead of info (#2320)
Browse files Browse the repository at this point in the history
* Log envelope delivery message with debug instead of info

This reduces the noise for most users.

Also deletes the `log_info` helper as now it's not used anymore.

* Update changelog
  • Loading branch information
st0012 authored Jun 9, 2024
1 parent c317a7a commit 389395e
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- Add query source support to `sentry-rails` ([#2313](https://github.com/getsentry/sentry-ruby/pull/2313))

The feature is only activated in apps that use Ruby 3.2+ and Rails 7.1+. By default only queries that take longer than 100ms will have source recorded, which can be adjusted by updating the value of `config.rails.db_query_source_threshold_ms`.
- Log envelope delivery message with debug instead of info ([#2320](https://github.com/getsentry/sentry-ruby/pull/2320))

### Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion sentry-ruby/lib/sentry/transport.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def send_envelope(envelope)
data, serialized_items = serialize_envelope(envelope)

if data
log_info("[Transport] Sending envelope with items [#{serialized_items.map(&:type).join(', ')}] #{envelope.event_id} to Sentry")
log_debug("[Transport] Sending envelope with items [#{serialized_items.map(&:type).join(', ')}] #{envelope.event_id} to Sentry")
send_data(data)
end
end
Expand Down
4 changes: 0 additions & 4 deletions sentry-ruby/lib/sentry/utils/logging_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ def log_error(message, exception, debug: false)
end
end

def log_info(message)
@logger.info(LOGGER_PROGNAME) { message }
end

def log_debug(message)
@logger.debug(LOGGER_PROGNAME) { message }
end
Expand Down
2 changes: 1 addition & 1 deletion sentry-ruby/spec/sentry/rake_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
message = `cd spec/support && bundle exec rake raise_exception_without_rake_integration 2>&1`
end.join

expect(message).not_to match(/Sentry/)
expect(message).not_to match(/Sending envelope with items/)
end

it "run rake task with original arguments" do
Expand Down
2 changes: 1 addition & 1 deletion sentry-ruby/spec/sentry/transport_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@
expect(subject.send_event(event)).to eq(event)

expect(io.string).to match(
/INFO -- sentry: \[Transport\] Sending envelope with items \[event\] #{event.event_id} to Sentry/
/DEBUG -- sentry: \[Transport\] Sending envelope with items \[event\] #{event.event_id} to Sentry/
)
end
end
Expand Down
1 change: 1 addition & 0 deletions sentry-ruby/spec/support/Rakefile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Sentry.init do |config|
config.dsn = 'http://12345:[email protected]/sentry/42'
config.background_worker_threads = 0
config.logger.level = Logger::DEBUG
end

task :raise_exception do
Expand Down

0 comments on commit 389395e

Please sign in to comment.