-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
log4rs handle support #111
Comments
How do you use log4rs with sentry? With |
You could make a proxy I assume. Sentry's log integration just dispatches to another logger. |
We don't use it yet, but are considering it. Even just an example of how to use it with something other than env logger would be great. |
I'd like to see something with rust/log4rs similar to java/logback, where I can add sentry as an appender that will upload all messages with warn level or higher. Code could look similar to this: let sentry = SentryAppender::builder()
// ...
.build();
let config = Config::builder()
// ...
.appender(Appender::builder().build("sentry", Box::new(sentry)))
// ...
.build(Root::builder().appender("sentry").build(LevelFilter::Warn))
.unwrap(); |
I've now made https://crates.io/crates/log4rs-sentry to get the desired behaviour |
I'd like to be able to use sentry with log4rs while still being able to change the log4rs config. Currently I'm using log4rs and I dynamically reload the config whenever the file changes using inotify. To do this, the init function of log4rs returns a handle that I keep in a static mut. After looking at the examples and the code, I don't see how that's possible right now since the init call doesn't return anything. I'm happy to use any workarounds that might be available.
The text was updated successfully, but these errors were encountered: