1 unstable release

0.2.0 Jan 20, 2023

#612 in Debugging

Download history 15/week @ 2024-09-01 4/week @ 2024-09-08 32/week @ 2024-09-22 8/week @ 2024-09-29 14/week @ 2024-10-06 17/week @ 2024-10-13 4/week @ 2024-10-20 2/week @ 2024-10-27 1/week @ 2024-11-03 12/week @ 2024-11-10 41/week @ 2024-11-17 52/week @ 2024-11-24 48/week @ 2024-12-01 23/week @ 2024-12-08 44/week @ 2024-12-15

169 downloads per month
Used in 2 crates

MIT license

22KB
524 lines

Logstash log sender

Crate Status

TCP log sender for Logstash.

Previously published under the name logstash-rs.

Get started

Add dependency to your Cargo.toml

qoollo-logstash-rs = 0.2

Or using upstream version from Github

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

Initialize logger

use qoollo_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
~202K SLoC