1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-05 19:42:11 +02:00

Get stacktrace out of lager context

Calling erlang:get_stacktrace() inside lager functions produces
stacktraces of the logging function itself, not the function which has failed.
This commit is contained in:
Evgeniy Khramtsov 2018-09-01 19:37:26 +03:00
parent b416527e4f
commit 88d0b71d58
11 changed files with 39 additions and 22 deletions

View file

@ -122,10 +122,11 @@ row_to_route(Domain, {ServerHost, NodeS, PidS, LocalHintS} = Row) ->
catch _:{bad_node, _} ->
[];
E:R ->
St = erlang:get_stacktrace(),
?ERROR_MSG("failed to decode row from 'route' table:~n"
"Row = ~p~n"
"Domain = ~s~n"
"Reason = ~p",
[Row, Domain, {E, {R, erlang:get_stacktrace()}}]),
[Row, Domain, {E, {R, St}}]),
[]
end.