Starting Report Browser (rb) for SASL error reporting while in a remote shell

Now we are deploying many instances of Erlang, and we see that the errors were thrown and would like to examine them ...

Usually we connect to the executable instance with the remote shell and access the Erlang console this way, but this does not work for rb messages or errors ...

How to remotely access SASL error messages without dropping the server, starting from it without disconnecting and looking at the shell?

+3
source share
3 answers

-remsh (${ROOTDIR}/bin/erl -name shell@${NODE_IP} -remsh ${NODE_NAME}). rb_server group_leader group_leader , rb :

(cacherl@192.168.2.31)1> rb:start().
{ok,<0.213.0>}
(cacherl@192.168.2.31)2> group_leader(group_leader(),erlang:whereis(rb_server)).
true
(cacherl@192.168.2.31)3> rb:show(1).

PROGRESS REPORT  <0.77.0>                                   2011-01-28 17:49:23
===============================================================================
supervisor                                                     {local,sasl_sup}
started
         [{pid,<4543.96.0>},
         {name,rb_server},
         {mfargs,{rb,start_link,[[]]}},
         {restart_type,temporary},
         {shutdown,brutal_kill},
         {child_type,worker}]

ok
(cacherl@192.168.2.31)4> 

EDIT: :

%% @doc Start the report browser and reset its group-leader. 
%% For use in a remote shell
start_remote_rb() ->
    {ok, Pid} = rb:start(),
    true = erlang:group_leader(erlang:group_leader(), Pid),
    ok.

,

+2

rb, , , , :

SASLs , . http://www.erlang.org/doc/man/sasl_app.html:

sasl_error_logger = Value <optional>

Value :

...

{file,FileName}

Installs sasl_report_file_hin the error logger. This forces all reports to go to a file FileName. FileNameis a string.

...

I also vaguely remember that there is a way to set a custom handler callback, but I cannot find it right now, unfortunately.

+1
source

Source: https://habr.com/ru/post/1734868/


All Articles