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.

You are reading Session Management Controller 3.12, an older release. The newest release is 3.17. Go to 3.17

Logging

Logging is an important operational aspect. It is required for OPS to get informed about certain important events. At the same time, too much logging not only leads to overload of someone who looks at the logs, but it also stresses the system to create and process these logs.

It is strongly advised to use either error or critical log level in production to avoid overloading the system.

System log levels

The log level indicates the severity of an event. According to the syslog protocol specified in RFC 5424Opens in a new tab, there are eight log levels:

Each log level is mapped to an integer value, and a log event passes the log level check if the integer value of its log level is less than or equal to the currently configured log level. That is, the check passes if the event is equally or more severe than the configured level.

Change the log level in a running erGW node

Follow these steps to change the log level in a running erGW node:

  1. Search for the SMC pods in the cluster:

    bash
  2. Pick the SMC pod for which you want to adjust the log level:

    bash
  3. Wait a few seconds, access the diagnosis shell, and get the current system log level:

    erlang
  4. Get the current configurations of the default logger handler:

    erlang
  5. Switch to the other level:

    • First, make the log handler accept the intended log level:
    erlang
    • Set the log level for all modules:
    erlang
    • Or set it for specific modules only:
    erlang
  6. Exit the diagnosis shell using ctrl+G, then q.

Add a special DEBUG log sink

You can redirect log messages from the default stdout to a file. This is most useful to write debug logs to a temporary file while keeping the default stdout log free of them to, for example, avoid overloading a log collector. To redirect log messages to a file:

  1. Log into a node and access the diagnosis shell as before.

  2. Check the current logging handler configuration:

    erlang

    A node with a default logger setup by default has two handlers, one for events from Erlang TLS stack (ssl_handler) and a default handler (default).

  3. Add a special debug handler:

    erlang

    This configuration uses the logger_std_h handler which appends log lines to the given file. You can also use the logger_disk_log_h handler which supports circular (wrapped) logs:

    erlang

    Adjust max_no_files and max_no_bytes to your needs.