5 stable releases
Uses old Rust 2015
2.2.0 | Dec 17, 2021 |
---|---|
2.1.1 | Sep 3, 2019 |
2.1.0 | Sep 2, 2019 |
2.0.0 | May 13, 2017 |
1.0.0 | Nov 8, 2016 |
#760 in Debugging
774 downloads per month
Used in 3 crates
(2 directly)
14KB
225 lines
slog-journald
This is a straightforward journald drain for slog-rs.
Journald and slog-rs work very well together since both support structured log data. This crate will convert structured data (that is, key-value pairs) into journald fields. Since, journald field names are more restrictive than keys in slog-rs, key names are sanitized to be valid journald fields.
This crate supports specialized handling of logged errors via features. Look into Cargo.toml
for more information.
lib.rs
:
Journald drain for slog-rs
Since Journald supports structured data, structured data passed to slog is simply forwarded to Journald as structured data.
This crate supports specialized handling of logged errors via features.
Look into Cargo.toml
for more information.
Examples
#[macro_use]
extern crate slog;
extern crate slog_journald;
use slog::*;
use slog_journald::*;
fn main() {
let root = Logger::root(JournaldDrain.ignore_res(), o!("build_di" => "12344"));
info!(root, "Testing journald"; "foo" => "bar");
}
Dependencies
~4MB
~81K SLoC