Changing the Log Level For LINSTOR Events Logging

This article explains how to change the log level of LINSTOR's controller and satellite components, both temporarily and persistently.

This article describes how to change the log level of the LINSTOR® controller and satellite services, both temporarily and persistently.

📝 NOTE: For Kubernetes environments see the instructions here: https://kb.linbit.com/log-levels-in-linstor-for-k8s.

LINSTOR provides several ways of changing the log level of its services. The available log levels are ERROR, WARN, INFO, DEBUG, and TRACE, in increasing order of verbosity, where the TRACE level will show the most information.

The default LINSTOR log level is INFO.

Changing Log Levels Persistently

You can persistently change the log level of a LINSTOR component (controller or satellite) service by editing the component’s configuration file. This requires a restart of the changed component’s service after editing its configuration file.

Controller

To change the controller log level to “TRACE”, you need to edit the controller configuration file, /etc/linstor/linstor.toml, and add the following section and key value pair:

[logging]
linstor_level = "TRACE"

Satellite

To change the satellite log level to “TRACE”, you need to edit the satellite configuration file, /etc/linstor/linstor_satellite.toml, and add the following section and key value pair:

[logging]
linstor_level = "TRACE"

Changing Log Levels Temporarily

You can also change the log level during active operation by using LINSTOR REST API endpoints for configuration management. These changes are lost when the changed component’s service is restarted, for example, when a node is restarted.

📝 NOTE:: The LINSTOR REST API transposes the log level key name (“level_linstor”) from what the key name is in the configuration files (“linstor_level”).

Controller

To change the controller log level to “TRACE”, you can make a PUT request to the controller configuration REST API endpoint, by entering:

curl -X PUT -H 'Content-Type: application/json' -d '{"log": {"level_linstor": "TRACE"}}' http://<your_controller>:3370/v1/controller/config

Satellite

To change the satellite log level to “TRACE”, you can make a PUT request to the satellite configuration REST API endpoint, by entering:

curl -X PUT -H 'Content-Type: application/json' -d '{"log": {"level_linstor": "TRACE"}}' http://<your_controller>:3370/v1/nodes/<your_satellite>/config

Cluster-Wide

To set the log level to “TRACE” for every component service in the cluster, controller or satellite, you can enter the following command:

curl -X PUT -H 'Content-Type: application/json' -d '{"log": {"level_linstor_global": "ERROR"}}' http://<your_controller>:3370/v1/controller/config

Updated 2023/10/17 - MAT

Reviewed 2023/10/18 - GH