1 unstable release

0.1.0 May 15, 2022

#801 in Debugging

Download history 91/week @ 2024-03-14 133/week @ 2024-03-21 77/week @ 2024-03-28 51/week @ 2024-04-04 106/week @ 2024-04-11 73/week @ 2024-04-18 23/week @ 2024-04-25 51/week @ 2024-05-02 47/week @ 2024-05-09 83/week @ 2024-05-16 109/week @ 2024-05-23 130/week @ 2024-05-30 33/week @ 2024-06-06 40/week @ 2024-06-13 126/week @ 2024-06-20 56/week @ 2024-06-27

279 downloads per month
Used in log4rs-logstash

MIT license

20KB
511 lines

logstash-rs

TCP log sender for Logstash.

Get started

Add dependency to your Cargo.toml

logstash-rs = 0.1.0

Or using upstream version from Github

logstash-rs = { git = "https://github.com/qoollo/rust-log4rs-logstash" }

Initialize logger

use logstash_rs::{BufferedSender, TcpSender};
use std::time::Duration;

fn main() {
    let logger = BufferedSender::new(
        TcpSender::new("localhost".to_string(), 3055, false), // hostname, port, use tls
        Some(64), // buffer size
        Some(Duration::from_secs(60)), // buffer lifetime
    );
    log::set_boxed_logger(Box::new(logger)).unwrap();

    log::error!("Test");
}

Dependencies

~2–14MB
~194K SLoC