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

#3 in #journald

Download history 132/week @ 2022-08-14 107/week @ 2022-08-21 136/week @ 2022-08-28 265/week @ 2022-09-04 175/week @ 2022-09-11 121/week @ 2022-09-18 50/week @ 2022-09-25 81/week @ 2022-10-02 67/week @ 2022-10-09 53/week @ 2022-10-16 69/week @ 2022-10-23 113/week @ 2022-10-30 79/week @ 2022-11-06 110/week @ 2022-11-13 93/week @ 2022-11-20 61/week @ 2022-11-27

352 downloads per month
Used in 3 crates (2 directly)

MPL-2.0/MIT/Apache-2.0

14KB
225 lines

slog-journald

Build Status] Gitter Documentation

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

~3.5MB
~72K SLoC