fluent-logger

Structured logger for Fluentd (OCaml)
README

A structured logger for Fluentd (OCaml)

Features

  • Inet/Unix domain sockets are available

  • Buffering data on memory if failed to send

  • Persistent connection

  • Exponential backoff for reconnection

Requirement

  • opam

  • dune

Build

$ opam install --deps-only .
$ dune build lib/fluent_logger.a

Install

$ opam install .

Test

$ dune runtest

Usage

let () =
  let module L = Fluent_logger in
  let logger = (* Fluent_logger.t *)
    (* INET domain socket *)
    L.create ()
    (* UNIX domain socket *)
    (* L.create_for_unix path *) 
  in
  L.post logger "production" (
    `FixMap [
      (L.of_string "id",   L.uint8_of_int i);
      (L.of_string "name", L.of_string "foobar");
      (L.of_string "age",  L.uint8_of_int 81);
      (L.of_string "pi",   L.of_float 3.14)
    ]
  );
  L.release logger

See also example directory.
You can build and execute it like this:

$ dune exec example/example.exe
Install
Sources
1.1.0.tar.gz
md5=1c2bcb8a1620fd584615cbfa614b1204
sha512=958094649f6b98be9510b52629d8893184554ec9f8506f8515e1b6001cb06f1c728bc023a96083b6d41113bceb75e3c938c887b554d5e512205536e2284be8e7
Dependencies
Reverse Dependencies