#log4rs #sentry #log

log4rs-sentry

Sentry Appender for log4rs

2 stable releases

1.0.1 May 12, 2019

#13 in #log4rs

Apache-2.0

6KB
63 lines

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();

Dependencies

~6.5–9MB
~185K SLoC