1 unstable release
new 0.13.1 | Dec 22, 2024 |
---|
#486 in Unix APIs
101 downloads per month
Used in i3im
12KB
248 lines
slog-syslog-jl - 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_jl;
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.4MB
~22K SLoC