@ -110,7 +110,7 @@ handle_event(Event, #state{sink = Sink, shaper = Shaper} = State) ->
true - >
{ ok , State #state { shaper = NewShaper } } ;
_ - >
? LOGFMT ( Sink , ? w arning, self ( ) , < < " lgErrLoggerH dropped ~p messages in the last second that exceeded the limit of ~p messages/sec " > > , [ Drop , NewShaper #lgShaper.hwm ] ) ,
? LOGFMT ( Sink , ? llvW arning, self ( ) , < < " lgErrLoggerH dropped ~p messages in the last second that exceeded the limit of ~p messages/sec " > > , [ Drop , NewShaper #lgShaper.hwm ] ) ,
evalGl ( Event , State #state { shaper = NewShaper } )
end ;
{ false , _ , NewShaper } - >
@ -122,7 +122,7 @@ handle_info({mShaperExpired, ?MODULE}, #state{sink = Sink, shaper = Shaper} = St
0 - >
ignore ;
Dropped - >
? LOGFMT ( Sink , ? w arning, self ( ) , < < " lgErrLoggerH dropped ~p messages in the last second that exceeded the limit of ~p messages/sec " > > , [ Dropped , Shaper #lgShaper.hwm ] )
? LOGFMT ( Sink , ? llvW arning, self ( ) , < < " lgErrLoggerH dropped ~p messages in the last second that exceeded the limit of ~p messages/sec " > > , [ Dropped , Shaper #lgShaper.hwm ] )
end ,
{ ok , State #state { shaper = Shaper #lgShaper { dropped = 0 } } } ;
handle_info ( _ Info , State ) - >
@ -192,7 +192,7 @@ logEvent(Event, #state{sink = Sink, raw = FormatRaw} = State) ->
end ,
? CRASH_LOG ( Event ) ,
{ Md , Formatted } = formatReasonMd ( Reason ) ,
? LOGFMT ( Sink , ? e rror, [ { pid , Pid } , { name , Name } | Md ] , < < " gen_server ~w terminated with reason: ~s " > > , [ Name , Formatted ] ) ;
? LOGFMT ( Sink , ? llvE rror, [ { pid , Pid } , { name , Name } | Md ] , < < " gen_server ~w terminated with reason: ~s " > > , [ Name , Formatted ] ) ;
" ** gen_ipc State machine " ++ _ - >
% % gen_server terminate
{ Reason , Name } =
@ -209,7 +209,7 @@ logEvent(Event, #state{sink = Sink, raw = FormatRaw} = State) ->
end ,
? CRASH_LOG ( Event ) ,
{ Md , Formatted } = formatReasonMd ( Reason ) ,
? LOGFMT ( Sink , ? e rror, [ { pid , Pid } , { name , Name } | Md ] , < < " gen_ipc ~w terminated with reason: ~s " > > , [ Name , Formatted ] ) ;
? LOGFMT ( Sink , ? llvE rror, [ { pid , Pid } , { name , Name } | Md ] , < < " gen_ipc ~w terminated with reason: ~s " > > , [ Name , Formatted ] ) ;
" ** State machine " ++ _ - >
% % Check if the terminated process is gen_fsm or gen_statem
% % since they generate the same exit message
@ -232,27 +232,27 @@ logEvent(Event, #state{sink = Sink, raw = FormatRaw} = State) ->
end ,
{ Md , Formatted } = formatReasonMd ( Reason ) ,
? CRASH_LOG ( Event ) ,
? LOGFMT ( Sink , ? e rror, [ { pid , Pid } , { name , Name } | Md ] , < < " ~s ~w in state ~w terminated with reason: ~s " > > , [ Type , Name , StateName , Formatted ] ) ;
? LOGFMT ( Sink , ? llvE rror, [ { pid , Pid } , { name , Name } | Md ] , < < " ~s ~w in state ~w terminated with reason: ~s " > > , [ Type , Name , StateName , Formatted ] ) ;
" ** gen_event handler " ++ _ - >
% % gen_event handler terminate
[ ID , Name , _ Msg , _ State , Reason ] = Args ,
{ Md , Formatted } = formatReasonMd ( Reason ) ,
? CRASH_LOG ( Event ) ,
? LOGFMT ( Sink , ? e rror, [ { pid , Pid } , { name , Name } | Md ] , < < " gen_event ~w installed in ~w terminated with reason: ~s " > > , [ ID , Name , Formatted ] ) ;
? LOGFMT ( Sink , ? llvE rror, [ { pid , Pid } , { name , Name } | Md ] , < < " gen_event ~w installed in ~w terminated with reason: ~s " > > , [ ID , Name , Formatted ] ) ;
" ** Cowboy handler " ++ _ - >
% % Cowboy HTTP server error
? CRASH_LOG ( Event ) ,
case Args of
[ Module , Function , Arity , _ Request , _ State ] - >
% % we only get the 5 - element list when its a non - exported function
? LOGFMT ( Sink , ? e rror, Pid ,
? LOGFMT ( Sink , ? llvE rror, Pid ,
< < " Cowboy handler ~p terminated with reason: call to undefined function ~p : ~p / ~p " > > ,
[ Module , Module , Function , Arity ] ) ;
[ Module , Function , Arity , _ Class , Reason | Tail ] - >
% % any other cowboy error_format list * always * ends with the stacktrace
StackTrace = lists : last ( Tail ) ,
{ Md , Formatted } = formatReasonMd ( { Reason , StackTrace } ) ,
? LOGFMT ( Sink , ? e rror, [ { pid , Pid } | Md ] ,
? LOGFMT ( Sink , ? llvE rror, [ { pid , Pid } | Md ] ,
< < " Cowboy handler ~p terminated in ~p : ~p / ~p with reason: ~s " > > , [ Module , Module , Function , Arity , Formatted ] )
end ;
" Ranch listener " ++ _ - >
@ -262,19 +262,19 @@ logEvent(Event, #state{sink = Sink, raw = FormatRaw} = State) ->
% % Error logged by cowboy , which starts as ranch error
[ Ref , ConnectionPid , StreamID , RequestPid , Reason , StackTrace ] - >
{ Md , Formatted } = formatReasonMd ( { Reason , StackTrace } ) ,
? LOGFMT ( Sink , ? e rror, [ { pid , RequestPid } | Md ] ,
? LOGFMT ( Sink , ? llvE rror, [ { pid , RequestPid } | Md ] ,
< < " Cowboy stream ~p with ranch listener ~p and connection process ~p "
" had its request process exit with reason: ~s " > > , [ StreamID , Ref , ConnectionPid , Formatted ] ) ;
[ Ref , _ Protocol , Worker , { [ { reason , Reason } , { mfa , { Module , Function , Arity } } , { stacktrace , StackTrace } | _ ] , _ } ] - >
{ Md , Formatted } = formatReasonMd ( { Reason , StackTrace } ) ,
? LOGFMT ( Sink , ? e rror, [ { pid , Worker } | Md ] , < < " Ranch listener ~p terminated in ~p : ~p / ~p with reason: ~s " > > , [ Ref , Module , Function , Arity , Formatted ] ) ;
? LOGFMT ( Sink , ? llvE rror, [ { pid , Worker } | Md ] , < < " Ranch listener ~p terminated in ~p : ~p / ~p with reason: ~s " > > , [ Ref , Module , Function , Arity , Formatted ] ) ;
[ Ref , _ Protocol , Worker , Reason ] - >
{ Md , Formatted } = formatReasonMd ( Reason ) ,
? LOGFMT ( Sink , ? e rror, [ { pid , Worker } | Md ] , < < " Ranch listener ~p terminated with reason: ~s " > > , [ Ref , Formatted ] ) ;
? LOGFMT ( Sink , ? llvE rror, [ { pid , Worker } | Md ] , < < " Ranch listener ~p terminated with reason: ~s " > > , [ Ref , Formatted ] ) ;
[ Ref , Protocol , Ret ] - >
% % ranch_conns_sup . erl module line 119 - 123 has three parameters error msg , log it .
{ Md , Formatted } = formatReasonMd ( Ret ) ,
? LOGFMT ( Sink , ? e rror, [ { pid , Protocol } | Md ] , < < " Ranch listener ~p terminated with result: ~s " > > , [ Ref , Formatted ] )
? LOGFMT ( Sink , ? llvE rror, [ { pid , Protocol } | Md ] , < < " Ranch listener ~p terminated with result: ~s " > > , [ Ref , Formatted ] )
end ;
" webmachine error " ++ _ - >
% % Webmachine HTTP server error
@ -289,40 +289,40 @@ logEvent(Event, #state{sink = Sink, raw = FormatRaw} = State) ->
Error
end ,
{ Md , Formatted } = formatReasonMd ( StackTrace ) ,
? LOGFMT ( Sink , ? e rror, [ { pid , Pid } | Md ] , < < " Webmachine error at path ~p : ~s " > > , [ Path , Formatted ] ) ;
? LOGFMT ( Sink , ? llvE rror, [ { pid , Pid } | Md ] , < < " Webmachine error at path ~p : ~s " > > , [ Path , Formatted ] ) ;
_ - >
? CRASH_LOG ( Event ) ,
? LOGFMT ( Sink , ? e rror, Pid , Fmt , Args )
? LOGFMT ( Sink , ? llvE rror, Pid , Fmt , Args )
end ;
_ - >
? CRASH_LOG ( Event ) ,
? LOGFMT ( Sink , ? e rror, Pid , Fmt , Args )
? LOGFMT ( Sink , ? llvE rror, Pid , Fmt , Args )
end ;
{ error_report , _ GL , { Pid , std_error , D } } - >
? CRASH_LOG ( Event ) ,
? LOGMSG ( Sink , ? e rror, Pid , printSillyList ( D ) ) ;
? LOGMSG ( Sink , ? llvE rror, Pid , printSillyList ( D ) ) ;
{ error_report , _ GL , { Pid , supervisor_report , D } } - >
? CRASH_LOG ( Event ) ,
case lists : sort ( D ) of
[ { errorContext , Ctx } , { offender , Off } , { reason , Reason } , { supervisor , Name } ] - >
Offender = formatOffender ( Off ) ,
{ Md , Formatted } = formatReasonMd ( Reason ) ,
? LOGFMT ( Sink , ? e rror, [ { pid , Pid } | Md ] ,
? LOGFMT ( Sink , ? llvE rror, [ { pid , Pid } | Md ] ,
< < " Supervisor ~w had child ~s exit with reason ~s in context ~w " > > ,
[ supervisorName ( Name ) , Offender , Formatted , Ctx ] ) ;
_ - >
? LOGMSG ( Sink , ? e rror, Pid , < < " SUPERVISOR REPORT " , ( printSillyList ( D ) ) / binary > > )
? LOGMSG ( Sink , ? llvE rror, Pid , < < " SUPERVISOR REPORT " , ( printSillyList ( D ) ) / binary > > )
end ;
{ error_report , _ GL , { Pid , crash_report , [ Self , Neighbours ] } } - >
? CRASH_LOG ( Event ) ,
{ Md , Formatted } = formatCrashReport ( Self , Neighbours ) ,
? LOGMSG ( Sink , ? e rror, [ { pid , Pid } | Md ] , < < " CRASH REPORT " , Formatted / binary > > ) ;
? LOGMSG ( Sink , ? llvE rror, [ { pid , Pid } | Md ] , < < " CRASH REPORT " , Formatted / binary > > ) ;
{ warning_msg , _ GL , { Pid , Fmt , Args } } - >
? LOGFMT ( Sink , ? w arning, Pid , Fmt , Args ) ;
? LOGFMT ( Sink , ? llvW arning, Pid , Fmt , Args ) ;
{ warning_report , _ GL , { Pid , std_warning , Report } } - >
? LOGMSG ( Sink , ? w arning, Pid , printSillyList ( Report ) ) ;
? LOGMSG ( Sink , ? llvW arning, Pid , printSillyList ( Report ) ) ;
{ info_msg , _ GL , { Pid , Fmt , Args } } - >
? LOGFMT ( Sink , ? i nfo, Pid , Fmt , Args ) ;
? LOGFMT ( Sink , ? llvI nfo, Pid , Fmt , Args ) ;
{ info_report , _ GL , { Pid , std_info , D } } when is_list ( D ) - >
Details = lists : sort ( D ) ,
case Details of
@ -332,13 +332,13 @@ logEvent(Event, #state{sink = Sink, raw = FormatRaw} = State) ->
no_log ;
_ - >
{ Md , Formatted } = formatReasonMd ( Reason ) ,
? LOGFMT ( Sink , ? i nfo, [ { pid , Pid } | Md ] , < < " Application ~w exited with reason: ~s " > > , [ App , Formatted ] )
? LOGFMT ( Sink , ? llvI nfo, [ { pid , Pid } | Md ] , < < " Application ~w exited with reason: ~s " > > , [ App , Formatted ] )
end ;
_ - >
? LOGMSG ( Sink , ? i nfo, Pid , printSillyList ( D ) )
? LOGMSG ( Sink , ? llvI nfo, Pid , printSillyList ( D ) )
end ;
{ info_report , _ GL , { Pid , std_info , D } } - >
? LOGFMT ( Sink , ? i nfo, Pid , " ~w " , [ D ] ) ;
? LOGFMT ( Sink , ? llvI nfo, Pid , " ~w " , [ D ] ) ;
{ info_report , _ GL , { P , progress , D } } - >
Details = lists : sort ( D ) ,
case Details of
@ -347,7 +347,7 @@ logEvent(Event, #state{sink = Sink, raw = FormatRaw} = State) ->
true - >
no_log ;
_ - >
? LOGFMT ( Sink , ? i nfo, P , < < " Application ~w started on node ~w " > > , [ App , Node ] )
? LOGFMT ( Sink , ? llvI nfo, P , < < " Application ~w started on node ~w " > > , [ App , Node ] )
end ;
[ { started , Started } , { supervisor , Name } ] - >
case lgUtil : get_env ( suppressSupStartStop , false ) of
@ -356,14 +356,14 @@ logEvent(Event, #state{sink = Sink, raw = FormatRaw} = State) ->
_ - >
MFA = formatMfa ( get_value ( mfargs , Started ) ) ,
Pid = get_value ( pid , Started ) ,
? LOGFMT ( Sink , ? d ebug, P , < < " Supervisor ~w started ~s at pid ~w " > > ,
? LOGFMT ( Sink , ? llvD ebug, P , < < " Supervisor ~w started ~s at pid ~w " > > ,
[ supervisorName ( Name ) , MFA , Pid ] )
end ;
_ - >
? LOGMSG ( Sink , ? i nfo, P , < < " PROGRESS REPORT " , ( printSillyList ( D ) ) / binary > > )
? LOGMSG ( Sink , ? llvI nfo, P , < < " PROGRESS REPORT " , ( printSillyList ( D ) ) / binary > > )
end ;
_ - >
? LOGFMT ( Sink , ? w arning, self ( ) , < < " Unexpected error_logger event ~w " > > , [ Event ] )
? LOGFMT ( Sink , ? llvW arning, self ( ) , < < " Unexpected error_logger event ~w " > > , [ Event ] )
end ,
case DidLog of
logged - >