소스 검색

Add support for handling ranch errors

pull/195/head
Ali Sabil 11 년 전
부모
커밋
d78c207cff
1개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. +13
    -0
      src/error_logger_lager_h.erl

+ 13
- 0
src/error_logger_lager_h.erl 파일 보기

@ -178,6 +178,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),

불러오는 중...
취소
저장