https://github.com/fluent/fluent-logger-ocaml
A structured logger for Fluentd (OCaml)
https://github.com/fluent/fluent-logger-ocaml
Last synced: 8 months ago
JSON representation
A structured logger for Fluentd (OCaml)
- Host: GitHub
- URL: https://github.com/fluent/fluent-logger-ocaml
- Owner: fluent
- License: apache-2.0
- Created: 2013-12-23T15:01:59.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-30T13:28:39.000Z (over 11 years ago)
- Last Synced: 2025-06-08T16:08:36.966Z (9 months ago)
- Language: OCaml
- Size: 172 KB
- Stars: 8
- Watchers: 11
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ocaml - fluent-logger
README
fluent-logger-ocaml
===================
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
Build
------------
$ make clean
$ make
$ make install
Build
------------
$ make test
Usage
------------
example.ml:
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
compile:
ocamlfind c -o example -package fluent-logger -linkpkg example.ml