Skip to content

Commit 045c2e2

Browse files
authored
feat(tracing): send both breadcrumbs and logs by default (#878)
1 parent a5932c0 commit 045c2e2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
- With this change, we capture errors returned by middleware only if those errors can be classified as server errors.
1111
- There is no change in behavior when it comes to errors returned by services, in which case the Sentry middleware only captures server errors exclusively.
1212

13+
### Behavioral changes
14+
15+
- feat(tracing): send both breadcrumbs and logs by default ([#878](https://github.com/getsentry/sentry-rust/pull/878)) by @lcian
16+
- If the `logs` feature flag is enabled, and `enable_logs: true` is set on your client options, the default Sentry `tracing` layer now sends logs for all events at or above INFO.
17+
1318
### Features
1419

1520
- feat(core): add Response context ([#874](https://github.com/getsentry/sentry-rust/pull/874)) by @lcian

sentry-tracing/src/layer.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ impl From<Vec<EventMapping>> for CombinedEventMapping {
7272
/// `warning` and `info`, and `debug` and `trace` logs are ignored.
7373
pub fn default_event_filter(metadata: &Metadata) -> EventFilter {
7474
match metadata.level() {
75+
#[cfg(feature = "logs")]
76+
&Level::ERROR => EventFilter::Event | EventFilter::Log,
77+
#[cfg(not(feature = "logs"))]
7578
&Level::ERROR => EventFilter::Event,
79+
#[cfg(feature = "logs")]
80+
&Level::WARN | &Level::INFO => EventFilter::Breadcrumb | EventFilter::Log,
81+
#[cfg(not(feature = "logs"))]
7682
&Level::WARN | &Level::INFO => EventFilter::Breadcrumb,
7783
&Level::DEBUG | &Level::TRACE => EventFilter::Ignore,
7884
}

0 commit comments

Comments
 (0)