在线文档教程

2.错误记录 | 2. Error Logging

2错误记录

2.1来自运行系统的错误信息

来自运行时系统的错误信息,即关于进程由于未被捕获的错误异常而终止的信息,默认写入terminal (tty):

=ERROR REPORT==== 9-Dec-2003::13:25:02 === Error in process <0.27.0> with exit value: {{badmatch,[1,2,3]},[{m,f,1},{shell,eval_loop,2}]}

错误信息由错误记录器处理,系统进程注册为error_logger。该进程接收来自Erlang运行时系统以及标准行为和不同Erlang/OTP应用程序的所有错误消息。

badarg运行系统使用的退出原因(如)在中描述Errors and Error Handling

有关进程error_logger及其用户界面(具有相同名称)的信息,请参阅error_logger(3)Kernel中的手册页。可以对系统进行配置,以便将错误信息写入文件或tty或两者。另外,用户定义的应用程序可以使用发送和格式化错误信息error_logger

2.2 ssl错误日志记录

标准行为(supervisorgen_server等等)发送进度和错误信息error_logger。如果SASL应用程序已启动,则此信息也会写入到tty中。有关更多信息,请参阅SASL Error LoggingSASL用户指南。

% erl -boot start_sasl Erlang (BEAM) emulator version 5.4.13 [hipe] [threads:0] [kernel-poll] =PROGRESS REPORT==== 31-Mar-2006::12:45:58 === supervisor: {local,sasl_safe_sup} started: [{pid,<0.33.0>}, {name,alarm_handler}, {mfa,{alarm_handler,start_link,[]}}, {restart_type,permanent}, {shutdown,2000}, {child_type,worker}] =PROGRESS REPORT==== 31-Mar-2006::12:45:58 === supervisor: {local,sasl_safe_sup} started: [{pid,<0.34.0>}, {name,overload}, {mfa,{overload,start_link,[]}}, {restart_type,permanent}, {shutdown,2000}, {child_type,worker}] =PROGRESS REPORT==== 31-Mar-2006::12:45:58 === supervisor: {local,sasl_sup} started: [{pid,<0.32.0>}, {name,sasl_safe_sup}, {mfa,{supervisor, start_link, [{local,sasl_safe_sup},sasl,safe]}}, {restart_type,permanent}, {shutdown,infinity}, {child_type,supervisor}] =PROGRESS REPORT==== 31-Mar-2006::12:45:58 === supervisor: {local,sasl_sup} started: [{pid,<0.35.0>}, {name,release_handler}, {mfa,{release_handler,start_link,[]}}, {restart_type,permanent}, {shutdown,2000}, {child_type,worker}] =PROGRESS REPORT==== 31-Mar-2006::12:45:58 === application: sasl started_at: nonode@nohost Eshell V5.4.13 (abort with ^G) 1>