Skip to content
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

Interest in simple log adapter? #37

Open
killercup opened this issue Nov 25, 2019 · 5 comments
Open

Interest in simple log adapter? #37

killercup opened this issue Nov 25, 2019 · 5 comments

Comments

@killercup
Copy link
Contributor

I might be interested in adding a simple logger adapter based on the log crate using the journald interface here. Is this something that would fit in this crate (behind a feature flag)?

@lucab
Copy link
Owner

lucab commented Nov 25, 2019

Thanks for reaching out. I'm not against that in principle, but at the same time I'm not completely sure this is the right place for that.

The current logging module is meant to only provide the low-level "send to journal" primitives (see review comment), but we can re-discuss that.

Is it part of a larger logging framework? If so, I do like slog and fern approach to have the logger implementation on their side.

@jabedude
Copy link
Contributor

Maybe we could have a separate module for implementing the log API with journald?

@killercup
Copy link
Contributor Author

Yeah, my idea was to have a have a log module that is opt-in with a feature flag that implements log::Log in a basic way, but maybe with support for journald's native key-value data. If it turns outn to be easy I could also imagine supporting env_logger::filter::Filter but in that case you should probably already use a larger logging framework.

@lucab
Copy link
Owner

lucab commented Nov 25, 2019

Ack, then I guess we can add that directly in logging, the additional logic seems small enough. We can also just expose it (without a feature flag), as I think we won't incur a lot of additional dependencies.

@swsnr
Copy link
Collaborator

swsnr commented May 28, 2021

I just published https://crates.io/crates/systemd-journal-logger which implements a logger over libsystemd's journal functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants