Fruently
A yet another Fluentd logger for Rust. Any version newer than Rust 1.18.0 is supported.
Note
If you use this library in Windows, please install Visual Studio 2015 or 2017 and rust compiler which is targeted for MSVC API and its package manager, which is called cargo via rustup.rs.
And then, follow the below usage instructions.
Usage
Add this to your Cargo.toml:
[]
= "~0.10.0"
and this to your crate root:
extern crate fruently;
Complete examples
Forwarding with JSON
extern crate fruently;
use Fluent;
use HashMap;
use JsonForwardable;
Forwarding with msgpack
extern crate fruently;
use Fluent;
use HashMap;
use MsgpackForwardable;
Forwarding asynchronously
Fruently does not have asynchronous API because Rust has std::thread::spawn
function to make asynchronous API from synchronous one.
If you want to send records into Fluentd asynchronously, please consider using std::thread::spawn
like: asynchronous example.
Backward compatibility
Using with Fluentd v0.12, you must specify time-as-integer
feature flag:
[]
= "~0.10.0"
= ["time-as-integer"]
Related Articles
- EventTime: http://www.clear-code.com/blog/2017/5/24.html (ja)
- Fluent Logger Reliability: http://www.clear-code.com/blog/2017/4/28.html (ja)
- Fundamentals: http://www.clear-code.com/blog/2016/4/22.html (ja)
LICENSE
MIT.