0.40.0
Logs
We've released two new integrations for Sentry structured logs, the tracing
and log
integration. Read below on how to start sending logs to Sentry.
Breaking changes
- refactor(logs): apply user attributes to log regardless of
send_default_pii
(#843) by @lcian- User attributes should be applied to logs regardless of
send_default_pii
. Therefore, that parameter was removed fromsentry_core::Scope::apply_to_log
.
- User attributes should be applied to logs regardless of
Features
- feat(tracing): add support for logs (#840) by @lcian
- To capture
tracing
events as Sentry structured logs, enable thelogs
feature of thesentry
crate. - Then, initialize the SDK with
enable_logs: true
in your client options. - Finally, set up a custom event filter to map events to logs based on criteria such as severity. For example:
let sentry_layer = sentry_tracing::layer().event_filter(|md| match *md.level() { tracing::Level::ERROR => EventFilter::Event, tracing::Level::TRACE => EventFilter::Ignore, _ => EventFilter::Log, });
- To capture
- feat(log): add support for logs (#841) by @lcian
- To capture
log
records as Sentry structured logs, enable thelogs
feature of thesentry
crate. - Then, initialize the SDK with
enable_logs: true
in your client options. - Finally, set up a custom event filter to map records to Sentry logs based on criteria such as severity. For example:
let logger = sentry::integrations::log::SentryLogger::new().filter(|md| match md.level() { log::Level::Error => LogFilter::Event, log::Level::Trace => LogFilter::Ignore, _ => LogFilter::Log, });
- To capture
- refactor(logs): cache default attributes and add OS attributes (#842) by @lcian
os.name
andos.version
are now being attached to logs as default attributes.
Fixes
Behavioral changes
- refactor(tracing): refactor internal code and improve docs (#839) by @lcian
- Errors carried by breadcrumbs will now be stored in the breadcrumb
data
under their original field name. - Before, they were all stored under a single key called
errors
.
- Errors carried by breadcrumbs will now be stored in the breadcrumb