diff --git a/CHANGELOG.md b/CHANGELOG.md index a95c7f33..2127cd47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,11 @@ - With this change, we capture errors returned by middleware only if those errors can be classified as server errors. - 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. +### Behavioral changes + +- feat(tracing): send both breadcrumbs and logs by default ([#878](https://github.com/getsentry/sentry-rust/pull/878)) by @lcian + - 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. + ### Features - feat(core): add Response context ([#874](https://github.com/getsentry/sentry-rust/pull/874)) by @lcian diff --git a/sentry-tracing/src/layer.rs b/sentry-tracing/src/layer.rs index efc4da54..5d3c59ec 100644 --- a/sentry-tracing/src/layer.rs +++ b/sentry-tracing/src/layer.rs @@ -72,7 +72,13 @@ impl From> for CombinedEventMapping { /// `warning` and `info`, and `debug` and `trace` logs are ignored. pub fn default_event_filter(metadata: &Metadata) -> EventFilter { match metadata.level() { + #[cfg(feature = "logs")] + &Level::ERROR => EventFilter::Event | EventFilter::Log, + #[cfg(not(feature = "logs"))] &Level::ERROR => EventFilter::Event, + #[cfg(feature = "logs")] + &Level::WARN | &Level::INFO => EventFilter::Breadcrumb | EventFilter::Log, + #[cfg(not(feature = "logs"))] &Level::WARN | &Level::INFO => EventFilter::Breadcrumb, &Level::DEBUG | &Level::TRACE => EventFilter::Ignore, }