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
Timestamps are formatted according to RFC3339, and the time designator is the character used as date and time separator.
Default is
The value of this parameter is used as
the
The time offset, either a string or an integer, to be used when formatting the timestamp.
An empty string is interpreted as local time. The
values
Strings, other than
Integers must be in microseconds, meaning that the
offset
The default value is an empty string, meaning that
timestamps are displayed in local time. However, for
backwards compatibility, if the SASL environment
variable
The value of this parameter is used as the
The default value for the
The log event used in the examples is:
?LOG_ERROR("name: ~p~nexit_reason: ~p",[my_name,"It crashed"])
Default template:
Example log entry:
2018-05-16T11:55:50.448382+02:00 error:
name: my_name
exit_reason: "It crashed"
Notice that all eight levels might occur in the heading,
not only
Default template:
Example log entry:
2018-05-16T11:55:50.448382+02:00 error: name: my_name, exit_reason: "It crashed"
Default template:
Example log entry:
2018-05-16T11:55:50.448382+02:00 error:
name: my_name
exit_reason: "It crashed"
This the formatter callback function to be called from handlers. The log event is processed as follows: