Crates.io | log4rs-sentry |
lib.rs | log4rs-sentry |
version | 1.0.1 |
source | src |
created_at | 2019-05-12 17:47:25.519412 |
updated_at | 2019-05-12 18:18:31.229839 |
description | Sentry Appender for log4rs |
homepage | |
repository | https://gitlab.com/msrd0/log4rs-sentry |
max_upload_size | |
id | 133816 |
size | 14,688 |
Sentry Appender for log4rs
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();