https://github.com/fluent/fluent-logger-erlang
A structured logger for Fluentd (Erlang)
https://github.com/fluent/fluent-logger-erlang
Last synced: 8 months ago
JSON representation
A structured logger for Fluentd (Erlang)
- Host: GitHub
- URL: https://github.com/fluent/fluent-logger-erlang
- Owner: fluent
- Created: 2015-03-26T22:50:02.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-27T07:25:13.000Z (almost 11 years ago)
- Last Synced: 2025-07-05T03:08:41.742Z (8 months ago)
- Language: Erlang
- Size: 383 KB
- Stars: 11
- Watchers: 14
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-2.0.txt
Awesome Lists containing this project
README
# fluent-logger-erlang
[](https://travis-ci.org/kuenishi/fluent-logger-erlang)
erlang logger using gen_event to output to fluent.
## Examples
```erl
1> {ok,_Pid} = gen_event:start({local, yourlogger}),
2> ok = gen_event:add_handler(yourlogger, fluent_event, myapp),
```
### eep18
```erl
3> ok = gen_event:notify(yourlogger, {access, {[{<<"agent">>,<<"foo">>}]}}),
% 2013-12-17 22:55:43 +0900 myapp.access: {"agent":"foo"}
```
### proplist
```erl
4> ok = gen_event:notify(yourlogger, {access, [{<<"agent">>,<<"foo">>}]}),
% 2013-12-17 22:55:53 +0900 myapp.access: {"agent":"foo"}
```
### with Lager
In `app.config` or `sys.config`:
```erl
{lager, [
{handlers, [
{fluent_event, {yourappname, hostname, 24224}}
]}]},
```