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

Journald #194

Open
imbolc opened this issue Feb 13, 2021 · 6 comments
Open

Journald #194

imbolc opened this issue Feb 13, 2021 · 6 comments

Comments

@imbolc
Copy link

imbolc commented Feb 13, 2021

My question is similar to #178, but about systemd journal as an additional target. Systemd crate already exposes log_record() as a part of its public api. What do you think about adding it as a dependency behind a feature-flag?

@jplatte
Copy link
Contributor

jplatte commented Feb 15, 2021

Would this approach work for journald integration?

@imbolc
Copy link
Author

imbolc commented Feb 15, 2021

It could be done with a trait object, but I'm afraid std::io::Write wont be enough, as it consumes just bytes. Journald stores structured data so it would need log level and all the logged variables if kv_unstable feature is enabled.

@jplatte
Copy link
Contributor

jplatte commented Feb 15, 2021

I see. Well I'm afraid I'm only doing light maintenance here and can't really provide more than a few cross links.

CC @KodrAus

@imbolc
Copy link
Author

imbolc commented Feb 16, 2021

I found it's easy to make it with tracing, in case someone else will need this: https://gist.github.com/imbolc/f75f924f66c129f0e1e910f59fb75c0d

@swsnr
Copy link

swsnr commented May 29, 2021

I wrote a wrapper to use the filter part of env_logger with any Log implementation (https://gist.github.com/lunaryorn/a2f63c6daa11fabec764caeb8a65dd00) which I use together with a separate journal logging crate

@TornaxO7
Copy link

TornaxO7 commented Sep 6, 2022

Are there any updates for this one yet?

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

No branches or pull requests

5 participants