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

Logging to syslog #18

Closed
dbrgn opened this issue Apr 19, 2016 · 10 comments
Closed

Logging to syslog #18

dbrgn opened this issue Apr 19, 2016 · 10 comments

Comments

@dbrgn
Copy link

dbrgn commented Apr 19, 2016

In your docs, you write:

//! An appender takes a log record and logs it somewhere, for example, to a file, the console, or the syslog.

Are there any docs on how to actually log to syslog? Is a custom appender required for that? Could a syslog appender be included in the crate or in a 3rd party crate?

@sfackler
Copy link
Collaborator

I don't know of anything that will currently hit syslog, but it should be easy to make. I think it'd probably make sense to build in a 3rd party crate for now - we can always merge it in later.

@alygin
Copy link

alygin commented Jun 25, 2016

#26

I've implemented the base functionality of the syslog appender. It supports plain and RFC 5424 messages and UDP/TCP protocols for now but can be easily extended by providing the RFC 3164 format support and unix sockets as a transport protocol option. I'll get back to these features shortly.

Any feedback on the code as well as on the documentation will be highly appreciated.

@alygin
Copy link

alygin commented Jun 25, 2016

RFC 3164 support is ready. Added to the same PR.

@im-0
Copy link
Contributor

im-0 commented Jul 16, 2017

I've made appender based on libc's syslog() function: https://crates.io/crates/log4rs-syslog. It supports only linux and other unix-like systems (tested on macOS). Maybe someone will find it useful.

@estk
Copy link
Owner

estk commented Oct 11, 2019

@im-0 If you're interested in merging log4rs-syslog into log4rs I'd be interested in helping with the effort. (Obviously behind a feature flag)

@estk estk closed this as completed Oct 11, 2019
@zonyitoo
Copy link

It seems that there is no respond from log4rs-syslog , could you add syslog support directly into this crate? @estk

@estk
Copy link
Owner

estk commented Oct 30, 2020

@zonyitoo I'd love to have that functionality, but i dont have time to implement it personally. if youd like to submit a PR i would be happy to assist.

@zonyitoo
Copy link

zonyitoo commented Oct 31, 2020

Would you mind copy-and-paste log4rs-syslog? I works well with 0.13.

If it is ok, I could make a PR like that. But it would be better to ask @im-0 again.

@kwinz
Copy link

kwinz commented Oct 31, 2023

Any updates on getting syslog functionality to log4rs since the last post 3 year ago? It seems was an implementation in #26 ~8 years ago, but then that never got merged because there "had to be a better way" than to duplicate the code from rust-syslog.
But since then progress stalled besides the mentioned log4rs-syslog, but that's not a full implementation, but a thin wrapper around libc's syslog() function.

What would be the best way to implement a cross platform network syslog backend for log4rs?
Make a new separate crate log4rs-syslog-native similar to rust-syslog? Or pull request to log4rs?
And then instead of calling syslog()

  • either base the implementation on Syslog appender #26
  • copy or call the implementation from the MIT licensed rust-syslog crate (relevant code probably less than 500 LOC)?
  • or reimplement it again?

PS: Any ideas about supporting RELP?

@bconn98
Copy link
Collaborator

bconn98 commented Dec 22, 2023

@kwinz I'd be interested in merging log4rs-syslog in. Do you see a better way to do it with option 2 by using rust-syslog? I think we should start with syslog and then move to support RELP with a similar model.

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

8 participants