From 0afab64f105c09976c7c07a64f54bf962ff9a18f Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Wed, 16 May 2018 14:12:23 +0200 Subject: Format logger timestamps according to RFC3339 --- lib/kernel/doc/src/logger_formatter.xml | 53 +++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 12 deletions(-) (limited to 'lib/kernel/doc/src') diff --git a/lib/kernel/doc/src/logger_formatter.xml b/lib/kernel/doc/src/logger_formatter.xml index 5f13e54365..370d61d338 100644 --- a/lib/kernel/doc/src/logger_formatter.xml +++ b/lib/kernel/doc/src/logger_formatter.xml @@ -155,11 +155,40 @@ and single_line. See Default Templates for more information

- utc = boolean() + time_designator = byte() -

If set to true, all dates are displayed in Universal - Coordinated Time.

-

Default is false.

+

Timestamps are formatted according to RFC3339, and the time + designator is the character used as date and time + separator.

+

Default is $T.

+

The value of this parameter is used as + the time_designator option + to + calendar:system_time_to_rcf3339/2.

+
+ time_offset = integer() | [byte()] + +

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 "Z", "z" or 0 are interpreted as + Universal Coordinated Time (UTC).

+

Strings, other than "Z", "z", or "", + must be on the form ±[hh]:[mm], for + example "-02:00" or "+00:00".

+

Integers must be in microseconds, meaning that the + offset 7200000000 is equivalent + to "+02:00".

+

The default value is an empty string, meaning that + timestamps are displayed in local time. However, for + backwards compatibility, if the SASL environment + variable + utc_log=true, the default is + changed to "Z", meaning that timestamps are displayed + in UTC.

+

The value of this parameter is used as the offset + option to + calendar:system_time_to_rcf3339/2.

@@ -174,7 +203,7 @@

The log event used in the examples is:

-?LOG_ERROR("name: ~p~nexit_reason: ~p",[my_reg_name,"It crashed"]) +?LOG_ERROR("name: ~p~nexit_reason: ~p",[my_name,"It crashed"]) legacy_header=true @@ -182,9 +211,9 @@

Default template: [{logger_formatter,header},"\n",msg,"\n"]

Example log entry:

- -=ERROR REPORT==== 29-Dec-2017::13:30:51.245123 === -name: my_reg_name + +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, @@ -198,7 +227,7 @@ exit_reason: "It crashed"

Default template: [time," ",level,": ",msg,"\n"]

Example log entry:

- 2017-12-29 13:31:49.640317 error: name: my_reg_name, exit_reason: "It crashed" + 2018-05-16T11:55:50.448382+02:00 error: name: my_name, exit_reason: "It crashed" legacy_header=false, single_line=false @@ -206,9 +235,9 @@ exit_reason: "It crashed"

Default template: [time," ",level,":\n",msg,"\n"]

Example log entry:

- -2017-12-29 13:32:25.191925 error: -name: my_reg_name + +2018-05-16T11:55:50.448382+02:00 error: +name: my_name exit_reason: "It crashed"
-- cgit v1.2.3