当 erlang 在分离模型中时,错误日志在哪里?

when erlang in detached model ,where is error log?

添加分离时,找不到错误信息,例如"Can't set long node name"

root@test:~# erl -name test
{error_logger,{{2015,3,11},{12,14,0}},"Can't set long node name!\nPlease check your configuration\n",[]}

......

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{{shutdown,{failed_to_start_child,net_sup,{shutdown,{failed_to_start_child,net_kernel,{'EXIT',nodistribution}}}}},{k
root@test:~#
root@test:~#
root@test:~#
root@test:~#
root@test:~#
root@test:~#
root@test:~# erl -name test -detached
root@test:~#
root@test:~#
root@test:~# ag Please erl_crash.dump

-detached
Starts the Erlang runtime system detached from the system console. Useful for running daemons and backgrounds processes. Implies -noinput.

同时 startnig erl 将所有日志发送到标准输出。只有在 kernel application comes up you can use error_logger 之后才能重定向到文件或任何其他自定义日志处理程序。 即使在内核应用程序启动之前发生的错误(例如在您的情况下)您也无法通过任何选项将其记录到文件中。 为此,您可以使用 run_erl (linux) or start_erl(windows)

run_erl [-daemon] pipe_dir/ log_dir "exec command [command_arguments]"

run_erl -daemon /tmp/ /home/abc "exec erl -name test"

您可以使用以下内容附加到上面启动的 erl

to_erl /tmp/

log_dir 将包含日志 run_erl.log 和 erlang.log.1。如果未正确启动,您可以在 erlang.log.N

中看到错误消息

详情请查看以上链接。