From 05e1548e5b452d4bfe3bc6837a1a1b51a6367f72 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Tue, 24 Apr 2018 14:55:29 +0200 Subject: Remove error_logger process and add logger process --- lib/kernel/doc/src/kernel_app.xml | 154 ++++++++++++++++++++++++++++++++------ 1 file changed, 131 insertions(+), 23 deletions(-) (limited to 'lib/kernel/doc/src/kernel_app.xml') diff --git a/lib/kernel/doc/src/kernel_app.xml b/lib/kernel/doc/src/kernel_app.xml index 0762cebc94..554d675383 100644 --- a/lib/kernel/doc/src/kernel_app.xml +++ b/lib/kernel/doc/src/kernel_app.xml @@ -51,10 +51,13 @@
- Error Logger Event Handlers -

Two standard error logger event handlers are defined in - the Kernel application. These are described in - error_logger(3).

+ Logger Handlers +

Two standard logger handlers are defined in + the Kernel application. These are described in the + Kernel User's Guide, + and in logger_std_h(3) + and logger_disk_log_h(3) + .

@@ -113,6 +116,7 @@
+ Configuration

The following configuration parameters are defined for the Kernel application. For more information about configuration parameters, @@ -176,34 +180,105 @@

Permissions are described in application:permit/2.

- error_logger = Value + logger_dest = Value

Value is one of:

tty -

Installs the standard event handler, which prints error - reports to stdio. This is the default option.

+

Installs the standard handler, + logger_std_h(3), with type set + to standard_io. This is the default + option.

{file, FileName} -

Installs the standard event handler, which prints error - reports to file FileName, where FileName +

Installs the standard handler, + logger_std_h(3), with type set + to {file, FileName}, where FileName is a string. The file is opened with encoding UTF-8.

+ {disk_log, FileName} +

Installs the disk_log handler, + logger_disk_log_h(3), with file set + to FileName (a string), and possibly other disk_log + parameters set by the environment variables + logger_disk_log_type, logger_disk_log_maxfiles and + logger_disk_log_maxbytes, + see below. The + file is opened with encoding UTF-8.

false -

No standard event handler is installed, but - the initial, primitive event handler is kept, printing +

No standard handler is installed, but + the initial, primitive handler is kept, printing raw event messages to tty.

silent -

Error logging is turned off.

+

No standard handler is started, and the initial, + primitive handler is removed.

- error_logger_format_depth = Depth + logger_level = Level + +

Value = emergency | alert | critical | error | warning | + notice | info | debug

+

This parameter specifies which log levels to log. The + specified level, and all levels that are more severe, will + be logged.

+

This configuration parameter is used both for the global + logger level, and for the standard handler started by + the Kernel application (see logger_dest variable above).

+

The default value is info

+
+ + logger_disk_log_type = halt | wrap + + logger_disk_log_maxfiles = integer() + + logger_disk_log_maxbytes = integer() + +

If logger_dest is set to {disk_log,File}, then these + parameters specify the configuration to use when opening the + disk log file. They specify the type of disk log, the + maximum number of files (if the type is wrap) and the + maximum size of each file, respectively.

+

The default values are:

+ +logger_disk_log_type = wrap +logger_disk_log_maxfiles = 10 +logger_disk_log_maxbytes = 1048576 +
+ + logger_sasl_compatible = boolean() + +

If this parameter is set to true, then the logger handler + started by kernel will not log any progress-, crash-, or + supervisor reports. If the SASL application is starated, + these log events will be sent to a second handler instance + named sasl_h, according to values of the SASL environment + variables sasl_error_logger + and sasl_errlog_type, see + SASL(6) +

+

The default value is false

+

See chapter Backwards + compatibility with error_logger for more + information about handling of the so called SASL reports.

+
+ + logger_log_progress = boolean() + +

If logger_sasl_compatible = false, + then logger_log_progress specifies if progress + reports from supervisor + and application_controller shall be logged or + not.

+

If logger_sasl_compatible = false, + then logger_log_progress is ignored.

+
+ + logger_format_depth = Depth -

Can be used to limit the size of the - formatted output from the error logger event handlers.

+ formatted output from the logger handlers.

This configuration parameter was introduced in OTP 18.1 and is experimental. Based on user feedback, it @@ -214,16 +289,16 @@ useless.

Depth is a positive integer representing the maximum - depth to which terms are printed by the error logger event + depth to which terms are printed by the logger handlers included in OTP. This - configuration parameter is used by the two event handlers - defined by the Kernel application and the two event - handlers in the SASL application. - (If you have implemented your own error handlers, this configuration - parameter has no effect on them.)

+ configuration parameter is used by the default formatter, + logger_formatter(3), + unless the formatter's depth parameter is explicitly set. + (If you have implemented your own formatter, this configuration + parameter has no effect on that.)

Depth is used as follows: Format strings - passed to the event handlers are rewritten. + received by the formatter are rewritten. The format controls ~p and ~w are replaced with ~P and ~W, respectively, and Depth is used as the depth parameter. For details, see @@ -234,7 +309,20 @@ 30. We recommend to test crashing various processes in your application, examine the logs from the crashes, and then increase or decrease the value.

-
+
+ logger_max_size = integer() | unlimited + +

This parameter specifies the maximum size (bytes) each + log event can have when printed by the standard logger + handler. If the resulting string after formatting an event + is bigger than this, it will be truncated before printed + to the handler's destination.

+
+ logger_utc = boolean() + +

If set to true, the default formatter will display + all dates in Universal Coordinated Time.

+
global_groups = [GroupTuple] @@ -496,6 +584,26 @@ MaxT = TickTime + TickTime / 4
+
+ Deprecated Configuration Parameters +

In OTP-21, a new API for logging was added to Erlang/OTP. The + old error_logger event manager, and event handlers + running on this manager, will still work, but they are not used + by default.

+

The following application environment variables can still be + set, but they will only be used if the corresponding new logger + variables are not set.

+ + error_logger + Replaced by logger_dest + error_logger_format_depth + Replaced by logger_format_depth + +

See Backwards + compatibility with error_logger for more + information.

+
+
See Also

app(4), -- cgit v1.2.3