[−][src]Module sentry::integrations::log  
Adds support for automatic breadcrumb capturing from logs.
Feature: with_log (enabled by default)
The log crate is supported in two ways.  First events can be captured as
breadcrumbs for later, secondly error events can be logged as events to
Sentry.  By default anything above Info is recorded as breadcrumb and
anything above Error is captured as error event.
Configuration
However due to how log systems in Rust work this currently requires you to slightly change your log setup. This is an example with the pretty env logger crate:
let mut log_builder = pretty_env_logger::formatted_builder(); log_builder.parse("info"); // or env::var("RUST_LOG") let logger = log_builder.build(); let options = sentry::integrations::log::LoggerOptions { global_filter: Some(logger.filter()), ..Default::default() }; sentry::integrations::log::init(Some(Box::new(logger)), options);
For loggers based on env_logger (like pretty_env_logger) you can also
use the env_logger integration which is
much easier to use.
Structs
| Logger | Provides a dispatching logger.  | 
| LoggerOptions | Logger specific options.  | 
Functions
| breadcrumb_from_record | Creates a breadcrumb from a given log record.  | 
| event_from_record | Creates an event from a given log record.  | 
| init | Initializes the logging system.  |