-
Notifications
You must be signed in to change notification settings - Fork 43
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
How to set minimum log levels? #174
Comments
The current journal There may be other crates that allow control over the output to the systemd journal, or if not, one could write one that uses the APIs exposed in this crate to log output. I've, in the past, thought about splitting out the support for Right now this is the extent of our logger: Modifying the I'm open to accepting changes to the included logger that add some filtering functionality. Even better if there's some existing log filtering crate we can just pull in and call in |
You're right, it makes more sense to add journal as a target to |
I'm not sure env_logger really has a setup for plugable outputs: it appears to just expose stderr and stdout. There are other logging systems (slog, tracing) that do have plugable outputs and have some support for filtering in similar ways to env_logger. For those, I believe the approach is to create a new crate that adapts the logging framework (slog/tracing) to the output sink (systemd journal, in this case). (Even if the solution you go with doesn't involve updating this systemd crate to add filtering, I'd be very interested in what you end up using) |
Yep, there's no plugins in env_logger, though they're already discussing adding a file Target, so I've opened a similar issue on journald. Tracing already has journald subscriber. It just emotionally hard for me to bring tracing into a simple cli tool with a synchronous workflow :) |
Hey :) I ended up using tracing, here's the setup: https://gist.github.com/imbolc/f75f924f66c129f0e1e910f59fb75c0d |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Is there a way to set different log levels for different crates (to filter verbose debug messages of some libs), something like
RUST_LOG
variable forenv_logger
? I can't find any configuration options aftersystemd::journal::JournalLog::init()
.The text was updated successfully, but these errors were encountered: