Each log handler has a configured formatter specified as a
module and a configuration term. The purpose of the formatter is
to translate the log events to a final printable string
(
The configuration term for
A positive integer representing the value of the option
with the same name to be used when calling
Default is
A positive integer representing the maximum depth to
which terms shall be printed by this formatter. Format
strings passed to this formatter are rewritten. The format
controls ~p and ~w are replaced with ~P and ~W,
respectively, and the value is used as the depth
parameter. For details, see
Default is
A positive integer representing the absolute maximum size a
string returned from this formatter can have. If the
formatted string is longer, after possibly being limited
by
Default is
If set to
Default is
If set to
Default is
A report callback is used by the formatter to transform log
messages on report form to a format string and
arguments. The report callback can be specified in the
metadata for the log event. If no report callback exist in
metadata,
If this configuration parameter is set, it replaces both the default report callback, and any report callback found in metadata. That is, all reports are converted by this configured function.
The value must be a function with arity 1,
returning
The template is a list of atoms, tuples and strings. The
atoms
#{key1=>#{key2=>my_value,
...}
...}
Strings in the template are printed literally.
The default template differs depending on the values
of
If set to
Default is
The default value for the
The log event used in the examples is:
?LOG_ERROR("name: ~p~nexit_reason: ~p",[my_reg_name,"It crashed"])
Default template:
Example log entry:
=ERROR REPORT==== 29-Dec-2017::13:30:51.245123 ===
name: my_reg_name
exit_reason: "It crashed"
Notice that all eight levels might occur in the heading,
not only
Default template:
Example log entry:
2017-12-29 13:31:49.640317 error: name: my_reg_name, exit_reason: "It crashed"
Default template:
Example log entry:
2017-12-29 13:32:25.191925 error:
name: my_reg_name
exit_reason: "It crashed"
This the formatter callback function to be called from handlers. The log event is processed as follows: