aboutsummaryrefslogtreecommitdiffstats
path: root/system/doc/system_principles/error_logging.xml
blob: ee3d68d80e1515e984e69f9c04fff9e47c9feba3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">

<chapter>
  <header>
    <copyright>
      <year>2003</year><year>2016</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    
    </legalnotice>

    <title>Error Logging</title>
    <prepared></prepared>
    <docno></docno>
    <date></date>
    <rev></rev>
    <file>error_logging.xml</file>
  </header>
  <marker id="error logging"></marker>

  <section>
    <title>Error Information From the Runtime System</title>
    <p>Error information from the runtime system, that is, information
      about a process terminating because of an uncaught error exception,
      is by default written to terminal (tty):</p>
    <code type="none"><![CDATA[
=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}]}]]></code>
    <p>The error information is handled by Logger, which is part of
      the Kernel application.</p>
    <p>The exit reasons (such as <c>badarg</c>) used by
      the runtime system are described in
      <seealso marker="doc/reference_manual:errors#exit_reasons">
      Errors and Error Handling</seealso>.</p>
    <p>For information about Logger and its user
      interface, see the
      <seealso marker="kernel:logger">logger(3)</seealso>
      manual page and
      the <seealso marker="kernel:logger_chapter">Logging</seealso>
      section in the Kernel User's Guide. The system can be configured so that
      log events are
      written to file or to tty, or both. In addition, user-defined
      applications can send and format log events using
      Logger.</p>
  </section>

  <section>
    <title>Log events from OTP behaviours</title>
    <p>The standard behaviours (<c>supervisor</c>, <c>gen_server</c>,
      and so on) send progress and error information to
      Logger. Progress reports are by default not logged, but can be
      enabled by setting the Kernel configuration
      parameter <c>logger_log_progress</c> to true. Supervisor
      reports, crash reports and other error and information reports
      are by default logged through the log handler which is
      set up when the Kernel application is started.</p>
    <p>Prior to OTP-21, supervisor, crash, and progress reports were
      only logged when the SASL application was running. This
      behaviour can, for backwards compatibility, be enabled by
      setting the Kernel configuration
      parameter <c>logger_sasl_compatible</c> to <c>true</c>. For more
      information, see
      <seealso marker="sasl:error_logging">SASL Error Logging</seealso>
      in the SASL User's Guide.</p>
    <pre>
% <input>erl -kernel logger_log_progress true</input>
Erlang/OTP 21 [erts-10.0] [source-76388a1] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

=PROGRESS REPORT==== 18-May-2018::21:33:41.705292 ===
    application: kernel
    started_at: nonode@nohost
=PROGRESS REPORT==== 18-May-2018::21:33:41.708900 ===
    application: stdlib
    started_at: nonode@nohost
=PROGRESS REPORT==== 18-May-2018::21:33:41.726003 ===
    supervisor: {local,kernel_safe_sup}
    started: [{pid,&lt;0.75.0>},
              {id,disk_log_sup},
              {mfargs,{disk_log_sup,start_link,[]}},
              {restart_type,permanent},
              {shutdown,1000},
              {child_type,supervisor}]
=PROGRESS REPORT==== 18-May-2018::21:33:41.726348 ===
    supervisor: {local,kernel_safe_sup}
    started: [{pid,&lt;0.76.0>},
              {id,disk_log_server},
              {mfargs,{disk_log_server,start_link,[]}},
              {restart_type,permanent},
              {shutdown,2000},
              {child_type,worker}]
Eshell V9.3.1  (abort with ^G)
1> </pre>
  </section>
</chapter>