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

#696 in Debugging

Download history 100/week @ 2023-10-20 94/week @ 2023-10-27 126/week @ 2023-11-03 142/week @ 2023-11-10 168/week @ 2023-11-17 157/week @ 2023-11-24 146/week @ 2023-12-01 162/week @ 2023-12-08 209/week @ 2023-12-15 134/week @ 2023-12-22 157/week @ 2023-12-29 162/week @ 2024-01-05 110/week @ 2024-01-12 97/week @ 2024-01-19 125/week @ 2024-01-26 76/week @ 2024-02-02

425 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
~81K SLoC