<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="../otp_doc.css" type="text/css"> <title>Erlang -- Error Logging</title> </head> <body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000"><div id="container"> <script id="js" type="text/javascript" language="JavaScript" src="../js/flipmenu/flipmenu.js"></script><script id="js2" type="text/javascript" src="../js/erlresolvelinks.js"></script><script language="JavaScript" type="text/javascript"> <!-- function getWinHeight() { var myHeight = 0; if( typeof( window.innerHeight ) == 'number' ) { //Non-IE myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myHeight = document.body.clientHeight; } return myHeight; } function setscrollpos() { var objf=document.getElementById('loadscrollpos'); document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2; } function addEvent(obj, evType, fn){ if (obj.addEventListener){ obj.addEventListener(evType, fn, true); return true; } else if (obj.attachEvent){ var r = obj.attachEvent("on"+evType, fn); return r; } else { return false; } } addEvent(window, 'load', setscrollpos); //--></script><div id="leftnav"><div class="innertube"> <img alt="Erlang logo" src="../erlang-logo.png"><br><small><a href="users_guide.html">User's Guide</a><br><a href="../pdf/otp-system-documentation-5.7.5.pdf">PDF</a><br><a href="../index.html">Top</a></small><p><strong>System Principles</strong><br><strong>User's Guide</strong><br><small>Version 5.7.5</small></p> <br><a href="javascript:openAllFlips()">Expand All</a><br><a href="javascript:closeAllFlips()">Contract All</a><p><small><strong>Chapters</strong></small></p> <ul class="flipMenu" imagepath="../js/flipmenu"> <li id="no" title="System Principles" expanded="false">System Principles<ul> <li><a href="system_principles.html"> Top of chapter </a></li> <li title="Starting the System"><a href="system_principles.html#id2255900">Starting the System</a></li> <li title="Restarting and Stopping the System"><a href="system_principles.html#id2255944">Restarting and Stopping the System</a></li> <li title="Boot Scripts"><a href="system_principles.html#id2257913">Boot Scripts</a></li> <li title="Code Loading Strategy"><a href="system_principles.html#id2252514">Code Loading Strategy</a></li> <li title="File Types"><a href="system_principles.html#id2259239">File Types</a></li> </ul> </li> <li id="loadscrollpos" title="Error Logging" expanded="true">Error Logging<ul> <li><a href="error_logging.html"> Top of chapter </a></li> <li title="Error Information From the Runtime System"><a href="error_logging.html#id2255094">Error Information From the Runtime System</a></li> <li title="SASL Error Logging"><a href="error_logging.html#id2252624">SASL Error Logging</a></li> </ul> </li> <li id="no" title="Creating a First Target System" expanded="false">Creating a First Target System<ul> <li><a href="create_target.html"> Top of chapter </a></li> <li title="Introduction"><a href="create_target.html#id2255197">Introduction</a></li> <li title="Creating a Target System"><a href="create_target.html#id2252325">Creating a Target System</a></li> <li title="Installing a Target System"><a href="create_target.html#id2253009">Installing a Target System</a></li> <li title="Starting a Target System"><a href="create_target.html#id2251834">Starting a Target System</a></li> <li title="System Configuration Parameters"><a href="create_target.html#id2252048">System Configuration Parameters</a></li> <li title="Differences from the Install Script"><a href="create_target.html#id2260125">Differences from the Install Script</a></li> <li title="Listing of target_system.erl"><a href="create_target.html#id2260155">Listing of target_system.erl</a></li> </ul> </li> </ul> </div></div> <div id="content"> <div class="innertube"> <h1>2 Error Logging</h1> <h3><a name="id2255094">2.1 Error Information From the Runtime System</a></h3> <p>Error information from the runtime system, that is, information about a process terminating due to an uncaught error exception, is by default written to terminal (tty):</p> <div class="example"><pre> =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}]}</pre></div> <p>The error information is handled by the <strong>error logger</strong>, a system process registered as <span class="code">error_logger</span>. This process receives all error messages from the Erlang runtime system and also from the standard behaviours and different Erlang/OTP applications.</p> <p>The exit reasons (such as <span class="code">badarg</span> above) used by the runtime system are described in <span class="bold_code"><a href="javascript:erlhref('../../','doc/reference_manual','errors.html#exit_reasons');">Errors and Error Handling</a></span> in the Erlang Reference Manual.</p> <p>The process <span class="code">error_logger</span> and its user interface (with the same name) are described in <span class="bold_code"><a href="javascript:erlhref('../../','kernel','error_logger.html');">error_logger(3)</a></span>. It is possible to configure the system so that error information is written to file instead/as well as tty. Also, it is possible for user defined applications to send and format error information using <span class="code">error_logger</span>.</p> <h3><a name="id2252624">2.2 SASL Error Logging</a></h3> <p>The standard behaviors (<span class="code">supervisor</span>, <span class="code">gen_server</span>, etc.) sends progress and error information to <span class="code">error_logger</span>. If the SASL application is started, this information is written to tty as well. See <span class="bold_code"><a href="javascript:erlhref('../../','sasl','error_logging.html');">SASL Error Logging</a></span> in the SASL User's Guide for further information.</p> <div class="example"><pre> % <span class="bold_code">erl -boot start_sasl</span> 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> </pre></div> </div> <div class="footer"> <hr> <p>Copyright © 1996-2010 Ericsson AB. All Rights Reserved.</p> </div> </div> </div></body> </html>