10 releases (breaking)
1.0.0-alpha9.1 |
|
---|---|
1.0.0-alpha9 |
|
1.0.0-alpha8 |
|
0.13.0 | Oct 15, 2021 |
0.6.0 | Jul 19, 2016 |
#622 in Unix APIs
347 downloads per month
Used in 8 crates
(4 directly)
13KB
270 lines
slog-syslog - Syslog drain for slog-rs
For more information, help, to report issues etc. see slog-rs.
lib.rs
:
Syslog drain for slog-rs
extern crate slog;
extern crate slog_syslog;
use slog::*;
use slog_syslog::Facility;
fn main() {
let o = o!("build-id" => "8dfljdf");
// log to a local unix sock `/var/run/syslog`
match slog_syslog::SyslogBuilder::new()
.facility(Facility::LOG_USER)
.level(slog::Level::Debug)
.unix("/var/run/syslog")
.start() {
Ok(x) => {
let root = Logger::root(x.fuse(), o);
},
Err(e) => println!("Failed to start syslog on `var/run/syslog`. Error {:?}", e)
};
}
Dependencies
~1–1.3MB
~22K SLoC