3 releases

Uses old Rust 2015

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

#805 in Debugging

Download history 17/week @ 2024-03-27 24/week @ 2024-04-03 1/week @ 2024-05-29

1,680 downloads per month

MIT/Apache

15KB
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

~2.5–4.5MB
~81K SLoC