For AI agents: this documentation is indexed for you in llms.txt, and all of it in /llms.txt. Every page is also available as markdown: append .md to its address.

Logging configuration

TPOSS writes log messages into stdout. Use the following configuration options to control TPOSS logging:

yaml

Log levels

These are the available TPOSS log levels ordered by importance:

  • emergency
  • alert
  • critical
  • error
  • warning
  • notice
  • info
  • debug

Caution

The default values are set to work well in most cases. Think carefully before changing them, and consider the system's load and use case, as the values depend on both. If the log level is set to debug, you may need to increase these values to handle the higher log volume. Otherwise, it is recommended to keep them low to avoid log overload.

Log format

The format of log messages is specified in the log.console.format configuration option. It can have one of these values:

  • json
  • default
  • A string that defines a custom format

When the log.console.format configuration option is set to json, all TPOSS log messages are printed in the JSON format. If set to default, the log messages are printed according to the following template: $time [$level] [code=$code] [node=$node] $msg. The template may have variables prefixed with the $ symbol. When the resulting log message is printed, each variable is replaced with its corresponding runtime value.

You can pass a custom format string to specify a template for log messages. The log.console.format supports the following variable names:

  • $time - UTC timestamp of the log entry
  • $level - Log level
  • $code - Code number. For more information, see the Error codes in logs document.
  • $msg - Log message
  • $pid - Process ID, which prints the log message
  • $node - TPOSS node name

For example, if you want to have logs in the logfmtOpens in a new tab format, configure TPOSS as follows:

yaml

This configuration prints log messages like:

text

Overload protection

Too many log messages may affect TPOSS performance and resource consumption. To prevent this, TPOSS provides several configuration options to control logging overload:

  • log.console.burst_limit_max_count - controls the maximum number of log messages that TPOSS handles within the time window defined in log.console.burst_limit_window_time (in milliseconds). If the number of messages is bigger than this limit, additional messages are dropped until the time window resets.
  • log.console.sync_mode_queue_len - defines the queue size threshold for switching to synchronous mode. By default, log messages are handled asynchronously. When the number of messages in the logger queue exceeds this value, synchronous handling is triggered. If the queue grows even further, TPOSS starts to drop and flush the messages. Such messages will never be printed. This behaviour is controlled by the log.console.drop_mode_queue_len and log.console.flush_queue_len configuration options. If sync_mode_queue_len equals drop_mode_queue_len, all the messages are handled asynchronously.

To ensure the overload protection mechanism works as expected, make sure the following condition is met:

text

For more information, read the official Erlang logger documentationOpens in a new tab.

If you experience issues with logging, such as performance degradation due to the high number of logs, refer to the Preventing logs overload document. It provides instructions on how to adjust the logging level and change the configuration for logging overload at runtime.

Note

Some of the logging messages may contain the code tag with the code number that describes an error or warning. For more information, see the Error codes in logs document.