Skip to content

0.40.0

Compare
Choose a tag to compare
@sentry-release-bot sentry-release-bot released this 17 Jun 08:49

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 from sentry_core::Scope::apply_to_log.

Features

  • feat(tracing): add support for logs (#840) by @lcian
    • To capture tracing events as Sentry structured logs, enable the logs feature of the sentry 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,
        });
  • feat(log): add support for logs (#841) by @lcian
    • To capture log records as Sentry structured logs, enable the logs feature of the sentry 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,
        });
  • refactor(logs): cache default attributes and add OS attributes (#842) by @lcian
    • os.name and os.version are now being attached to logs as default attributes.

Fixes

  • fix(logs): send environment in sentry.environment default attribute (#837) by @lcian

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.

Dependencies