Add webmachine access log handler
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:
app.config
sys.config
{lager, [ {handlers, [ {fluent_event, {yourappname, hostname, 24224}} ]}]},
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
fluent-logger-erlang
erlang logger using gen_event to output to fluent.
Examples
eep18
proplist
with Lager
In
app.configorsys.config: