erlang logger using gen_event to output to fluent.
1> {ok,_Pid} = gen_event:start({local, yourlogger}),
2> ok = gen_event:add_handler(yourlogger, fluent_event, myapp),
3> ok = gen_event:notify(yourlogger, {access, {[{<<"agent">>,<<"foo">>}]}}),
% 2013-12-17 22:55:43 +0900 myapp.access: {"agent":"foo"}
4> ok = gen_event:notify(yourlogger, {access, [{<<"agent">>,<<"foo">>}]}),
% 2013-12-17 22:55:53 +0900 myapp.access: {"agent":"foo"}
In app.config
or sys.config
:
{lager, [
{handlers, [
{fluent_event, {yourappname, hostname, 24224}}
]}]},