log4rs-sentry

Crates.iolog4rs-sentry
lib.rslog4rs-sentry
version1.0.1
sourcesrc
created_at2019-05-12 17:47:25.519412
updated_at2019-05-12 18:18:31.229839
descriptionSentry Appender for log4rs
homepage
repositoryhttps://gitlab.com/msrd0/log4rs-sentry
max_upload_size
id133816
size14,688
(msrd0)

documentation

README

log4rs-sentry

Sentry Appender for log4rs

Usage

Add the following to your Cargo.toml:

log4rs-sentry = "^1.0"

Now, when configuring your log4rs logger, use the following code:

use log4rs_sentry::SentryAppender;

let sentry_encoder = PatternEncoder::new("{m}");
let sentry = SentryAppender::new(Box::new(sentry_encoder));

let config = Config::builder()
		.appender(Appender::builder().build("sentry", Box::new(sentry)))
		// other appenders
		.build(Root::builder()
				.appender("sentry")
				// other appenders
				.build(LevelFilter::Warn))
		.unwrap();
Commit count: 13

cargo fmt