kernel(7) | Erlang Application Definition | kernel(7) |
kernel - The Kernel application.
The Kernel application has all the code necessary to run the Erlang runtime system: file servers, code servers, and so on.
The Kernel application is the first application started. It is mandatory in the sense that the minimal system based on Erlang/OTP consists of Kernel and STDLIB. Kernel contains the following functional areas:
Two standard logger handlers are defined in the Kernel application. These are described in the Kernel User's Guide, and in the logger_std_h(3erl) and logger_disk_log_h(3erl) manual pages.
Asynchronous OS signals may be subscribed to via the Kernel applications event manager (see OTP Design Principles and gen_event(3erl)) registered as erl_signal_server. A default signal handler is installed which handles the following signals:
Any event handler added to erl_signal_server must handle the following events.
Setting OS signals are described in os:set_signal/2.
The following configuration parameters are defined for the Kernel application. For more information about configuration parameters, see file app(5).
The parameter is described in application:load/2.
Permissions are described in application:permit/2.
The logger parameter is described in section Logging in the Kernel User's Guide.
Level = emergency | alert | critical | error | warning | notice | info | debug | all | none
To change the primary log level at runtime, use logger:set_primary_config(level, Level).
Defaults to notice.
If this parameter is set to true, the default Logger handler does not log any progress-, crash-, or supervisor reports. If the SASL application is then started, it adds a Logger handler named sasl, which logs these events according to values of the SASL configuration parameter sasl_error_logger and sasl_errlog_type.
See section Deprecated Error Logger Event Handlers and Configuration in the sasl(7) manual page for information about the SASL configuration parameters.
See section SASL Error Logging in the SASL User's Guide, and section Backwards Compatibility with error_logger in the Kernel User's Guide for information about the SASL error logging functionality, and how Logger can be backwards compatible with this.
Defaults to false.
Defines global groups, see global_group(3erl). In this parameter:
Defines a list of extra socket options to be used when opening the listening socket for a distributed Erlang node. See gen_tcp:listen/2.
Defines a list of extra socket options to be used when connecting to other distributed Erlang nodes. See gen_tcp:connect/4.
SetupTime must be a positive integer or floating point number, and is interpreted as the maximum allowed time for each network operation during connection setup to another Erlang node. The maximum allowed value is 120. If higher values are specified, 120 is used. Default is 7 seconds if the variable is not specified, or if the value is incorrect (for example, not a number).
Notice that this value does not limit the total connection setup time, but rather each individual network operation during the connection setup and handshake.
Specifies the net_kernel tick time in seconds. This is the approximate time a connected node may be unresponsive until it is considered down and thereby disconnected.
Once every TickTime/4 seconds, each connected node is ticked if nothing has been sent to it during that last TickTime/4 interval. A tick is a small package sent on the connection. A connected node is considered to be down if no ticks or payload packages have been received during the last four TickTime/4 intervals. This ensures that nodes that are not responding, for reasons such as hardware errors, are considered to be down.
As the availability is only checked every TickTime/4 seconds, the actual time T a node have been unresponsive when detected may vary between MinT and MaxT, where:
MinT = TickTime - TickTime / 4 MaxT = TickTime + TickTime / 4
TickTime defaults to 60 seconds. Thus, 45 < T < 75 seconds.
Notice that all communicating nodes are to have the same TickTime value specified, as it determines both the frequency of outgoing ticks and the expected frequency of incominging ticks.
Normally, a terminating node is detected immediately by the transport protocol (like TCP/IP).
Defaults to true.
Defaults to false. If this parameter is undefined, the server is started if parameter distributed is set.
Defaults to false.
SlaveIP = string() | atom | {integer(),integer(),integer(),integer()},
where 0 <= integer() <=255.
Examples of SlaveIP in atom, string, and tuple form:
'150.236.16.70', "150,236,16,70", {150,236,16,70}.
Defaults to [].
Defaults to false.
Starts the default pg scope server (see pg(3erl)) if the parameter is true. This parameter is to be set to true in an embedded system that uses this service.
Defaults to false.
Starts the pg2 server (see pg2(3erl)) if the parameter is true. This parameter is to be set to true in an embedded system that uses this service.
Defaults to false.
Defaults to false.
Sets a function that application_controller calls when it starts to terminate. The function is called as Mod:Func(Reason), where Reason is the terminate reason for application_controller, and it must return as soon as possible for application_controller to terminate properly.
Where:
Specifies a list of rules for use by filelib:find_file/2 filelib:find_source/2 If this is set to some other value than the empty list, it replaces the default rules. Rules can be simple pairs of directory suffixes, such as {"ebin", "src"}, which are used by filelib:find_file/2, or triples specifying separate directory suffix rules depending on file name extensions, for example [{".beam", ".erl", [{"ebin", "src"}]}, which are used by filelib:find_source/2. Both kinds of rules can be mixed in the list.
The interpretation of ObjDirSuffix and SrcDirSuffix is as follows: if the end of the directory name where an object is located matches ObjDirSuffix, then the name created by replacing ObjDirSuffix with SrcDirSuffix is expanded by calling filelib:wildcard/1, and the first regular file found among the matches is the source file.
In Erlang/OTP 21.0, a new API for logging was added. The old error_logger event manager, and event handlers running on this manager, still work, but they are no longer used by default.
The following application configuration parameters can still be set, but they are only used if the corresponding configuration parameters for Logger are not set.
erl -kernel logger '[{handler,default,logger_std_h,#{config=>#{file=>"/tmp/erlang.log"}}}]'
erl -kernel logger '[{handler,default,logger_std_h,#{formatter=>{logger_formatter,#{legacy_header=>true,template=>[{logger_formatter,header},"\n",msg,"\n"],depth=>10}}}]'
See Backwards compatibility with error_logger for more information.
app(5), application(3erl), code(3erl), disk_log(3erl), erl_boot_server(3erl), erl_ddll(3erl), file(3erl), global(3erl), global_group(3erl), heart(3erl), inet(3erl), logger(3erl), net_kernel(3erl), os(3erl), pg(3erl), pg2(3erl), rpc(3erl), seq_trace(3erl), user(3erl), timer(3erl)
kernel 7.2 | Ericsson AB |