#log #logging #iot #sink

compressed_log

Log compression on the fly

8 releases

✓ Uses Rust 2018 edition

0.1.7 Jan 7, 2019
0.1.6 Jan 7, 2019
0.1.2 Dec 21, 2018

#44 in Compression

Download history 106/week @ 2018-12-25 1/week @ 2019-01-01 150/week @ 2019-01-08

85 downloads per month

Custom license

18KB
397 lines

compressed_log

A Rust crate to compress logs on the fly, and send them over the network after reaching a configured threshold.

Features

  • Uses log API
  • LZ4 to compress log on the fly
  • Transmits compressed data over persistent WebSocket connection
  • Configurable threshold which will trigger in-memory log rotation and data transmission.

WIP.

Example

Check out examples folder for more examples.

WIP.

Client:

let level = Level::Info;
let logger = LoggerBuilder::new()
    .set_level(level)
    .set_compression_level(Compression::Slow)
    .set_sink_url("http://127.0.0.1:8000/sink/")
    .build()?;
log::set_boxed_logger(Box::new(logger))?;
log::set_max_level(level.to_level_filter());

Server:

WIP.

By default compressed_log expects WebSocket endpoint to understand binary messages that contains data compressed with LZ4.

Dependencies

~21MB
~445K SLoC