在远程 shell 中运行报告浏览器 (rb) 以获取 SASL 错误报告

发布于 2024-08-23 12:02:54 字数 184 浏览 17 评论 0原文

各位,我们现在部署了很多 Erlang 实例,我们看到了错误,并想检查它们...

通常我们使用远程 shell 连接到正在运行的实例,并以这种方式访问​​ Erlang 控制台,但这并不对于 rb 或错误消息不起作用...

如何在不删除服务器、不分离启动服务器并查看 shell 的情况下远程访问我的 SASL 错误消息?

Folks we are now delploying a lot of Erlang instances and we are seeing bugs been thrown and would like to examine them...

Normally we connect to the running instance with a remote shell and get access to an Erlang console that way, but this doesn't work for rb or error messages...

How do I get remote access to my SASL error messages without dropping the server, starting it non-detached and looking at the shell?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

七秒鱼° 2024-08-30 12:02:54

我在 R11B 中遇到了这个问题,最终创建了一个在远程 shell 上工作的 rb 克隆(http://github.com/archaelus/erms/blob/master/src/erms_rb.erl)。诀窍是发现<的group_leader a href="http://github.com/archaelus/erms/blob/master/src/erms_rb.erl#L161" rel="nofollow noreferrer">调用者 然后 将输出发送到那里

我也许应该整理一下并将其作为补丁提交给 rb。

I ran into this back in R11B and ended up creating a clone of rb that works over a remote shell (http://github.com/archaelus/erms/blob/master/src/erms_rb.erl). The trick is to discover the group_leader of the caller and then send output there.

I should probably tidy that up and submit it as a patch to rb.

筑梦 2024-08-30 12:02:54

我通过 -remsh (${ROOTDIR}/bin/erl -name shell@${NODE_IP} -remsh ${NODE_NAME}) 启动远程 shell。一旦在那里,我将 rb_server group_leader 设置为 shell 的当前 group_leader,并且 rb 从此将其输出打印到活动 shell:

([email protected])1> rb:start().
{ok,<0.213.0>}
([email protected])2> group_leader(group_leader(),erlang:whereis(rb_server)).
true
([email protected])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
([email protected])4> 

编辑:为了方便起见,将其封装在函数中:

%% @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.

问候,
汤姆

I start my remote shell via -remsh (${ROOTDIR}/bin/erl -name shell@${NODE_IP} -remsh ${NODE_NAME}). once there I set the rb_server group_leader to the current group_leader of the shell and rb henceforth prints its output to the active shell:

([email protected])1> rb:start().
{ok,<0.213.0>}
([email protected])2> group_leader(group_leader(),erlang:whereis(rb_server)).
true
([email protected])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
([email protected])4> 

EDIT: encapsulate it in a function for convenience:

%% @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.

regards,
Tom

顾北清歌寒 2024-08-30 12:02:54

我没有使用过 rb,所以我对此不太了解,但也许这会对您有所帮助:

您可以设置 SASL 错误报告处理程序以写入磁盘,请参阅 http://www.erlang.org/doc/man/sasl_app.html

sasl_error_logger = Value <optional>

是一of:

...

{file,FileName}

在错误记录器中安装 sasl_report_file_h。这使得所有报告都转到文件 FileNameFileName 是一个字符串。

...

我还依稀记得有一种方法可以安装自定义处理程序回调,但不幸的是,我现在似乎找不到它。

I haven't used rb, so I don't know much about it, but maybe this will help you anyway:

You can set SASLs error report handler to write to disk, see http://www.erlang.org/doc/man/sasl_app.html :

sasl_error_logger = Value <optional>

Value is one of:

...

{file,FileName}

Installs sasl_report_file_h in the error logger. This makes all reports go to the file FileName. FileName is a string.

...

I also dimly remember there being a way to install a custom handler callback, but I can't seem to find it right now, unfortunately.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文