3 releases

Uses old Rust 2015

0.1.2 Jul 25, 2019
0.1.1 Jul 25, 2019
0.1.0 Jun 18, 2019

#247 in Debugging

Download history 1165/week @ 2022-06-07 2092/week @ 2022-06-14 1487/week @ 2022-06-21 859/week @ 2022-06-28 877/week @ 2022-07-05 1500/week @ 2022-07-12 853/week @ 2022-07-19 865/week @ 2022-07-26 1773/week @ 2022-08-02 2383/week @ 2022-08-09 1136/week @ 2022-08-16 833/week @ 2022-08-23 1174/week @ 2022-08-30 2457/week @ 2022-09-06 2444/week @ 2022-09-13 3367/week @ 2022-09-20

9,638 downloads per month

MIT/Apache

14KB
332 lines

slog-gelf - A GELF integration for slog-rs

Build Status

How to use

#[macro_use]
extern crate slog;
extern crate hostname;
extern crate slog_async;
extern crate slog_gelf;

use slog::Drain;

fn main() {
    let hostname = hostname::get_hostname().unwrap();

    let drain = slog_gelf::Gelf::new(&hostname, "192.168.0.1011:12201")
        .unwrap()
        .fuse();
    let drain = slog_async::Async::new(drain).build().fuse();
    let log = slog::Logger::root(drain, o!("key" => "value"));

    info!(log,
        "An example log message";
        "k1" => "v1",
        "k2" => "v2",
    );
}

Dependencies

~1.9–2.6MB
~48K SLoC