Expand description

Adds support for automatic Breadcrumb and Event capturing from logs.

The log crate is supported in two ways. First, logs can be captured as breadcrumbs for later. Secondly, error logs can be captured as events to Sentry. By default anything above Info is recorded as a breadcrumb and anything above Error is captured as error event.


let mut log_builder = pretty_env_logger::formatted_builder();
let logger = sentry_log::SentryLogger::with_dest(log_builder.build());


let _sentry = sentry::init(());

log::info!("Generates a breadcrumb");
log::error!("Generates an event");

Or one might also set an explicit filter, to customize how to treat log records:

use sentry_log::LogFilter;

let logger = sentry_log::SentryLogger::new().filter(|md| match md.level() {
    log::Level::Error => LogFilter::Event,
    _ => LogFilter::Ignore,


A noop log::Log that just ignores everything.

Provides a dispatching logger.


The action that Sentry should perform for a log::Metadata.

The type of Data Sentry should ingest for a log::Record.


Creates a [Breadcrumb] from a given log::Record.

Converts a log::Level to a Sentry [Level]

The default log filter.

Creates an [Event] from a given log::Record.

Creates an exception [Event] from a given log::Record.