瀏覽代碼

Merge branch 'feature/ranch-support' of https://github.com/soundrop/lager into intg

pull/277/head
Mark Allen 10 年之前
父節點
當前提交
80eed725be
共有 1 個文件被更改,包括 13 次插入0 次删除
  1. +13
    -0
      src/error_logger_lager_h.erl

+ 13
- 0
src/error_logger_lager_h.erl 查看文件

@ -196,6 +196,19 @@ log_event(Event, State) ->
"Cowboy handler ~p terminated in ~p:~p/~p with reason: ~s",
[Module, Module, Function, Arity, format_reason({Reason, StackTrace})])
end;
"Ranch listener "++_ ->
%% Ranch errors
?CRASH_LOG(Event),
case Args of
[Ref, _Protocol, Worker, {[{reason, Reason}, {mfa, {Module, Function, Arity}}, {stacktrace, StackTrace} | _], _}] ->
?LOGFMT(error, Worker,
"Ranch listener ~p terminated in ~p:~p/~p with reason: ~s",
[Ref, Module, Function, Arity, format_reason({Reason, StackTrace})]);
[Ref, _Protocol, Worker, Reason] ->
?LOGFMT(error, Worker,
"Ranch listener ~p terminated with reason: ~s",
[Ref, format_reason(Reason)])
end;
"webmachine error"++_ ->
%% Webmachine HTTP server error
?CRASH_LOG(Event),

Loading…
取消
儲存