Cloud load balancer logs
Logging is available for load balancers in pools ru-2, ru-7, and ru-8.:::
The Log Platform service is used for logging the load balancer. For more information about the principle of operation and the cost of the service, see the instruction General information about the Log Platform service.
The following event types are logged for the load balancer:
- HTTP request;
- TCP connection;
- administrative event — change of server status in the target group.
Depending on the type of event, a different set of fields is recorded for the event.
To collect load balancer logs, you must enable logging for the load balancer. You can only get logs through the API.If you no longer need to collect logs, you can disable logging.
Enable logging for the load balancer
You can enable logging through the API or in the control panel — when creating a load balancer or for an existing load balancer.
Enable logging for an existing load balancer
Logging uses some of the balancer's computational resources.
Control panel
OpenStack API
- In the dashboard, on the top menu, click Products and select Cloud Servers.
- Go to Balancers → Balancers tab.
- Open the balancer page.
- In the Settings block, in the Logging field, click .
- Check the Collect balancer technical logs checkbox.
- Select a log group or create a new group. Logs from one or more balancers can be recorded in one group.
- If you have selected a new group, enter its name.
- Click Save.
-
Get an IAM token for the project in which the balancer was created.
-
In the query output, copy the value of
X-Subject-Token
. -
Open the CLI.
-
Enable logging for the balancer:
curl --location --request PUT 'https://<pool>.cloud.api.selcloud.ru/load-balancer/v2/lbaas/loadbalancers/<loadbalancer_uuid>/log_offloading' \
--header 'X-Auth-Token: <x_auth_token>' \
--header 'Content-Type: application/json;charset=utf-8' \
--data '{
"log_group": "<log_group_name>"
}Specify:
<pool>
— pool in which the balancer is created, for exampleru-8
. Address (URL) depends on the region and pool, you can look in the URL list;<loadbalancer_uuid>
— ID of the load balancer. You can view the ID in control panel: in the top menu click Products → Cloud Servers → Balancers → balancer page → under the balancer name, click ;<x_auth_token>
— The IAM token for the project you copied in step 2;<log_group_name>
— name of the log group where the balancer logs will be written. More information about log groups in the subsection Working principle General information about the Log Platform service.
Turn off logging for the load balancer
Control panel
OpenStack API
- In the dashboard, on the top menu, click Products and select Cloud Servers.
- Go to Balancers → Balancers tab.
- Open the balancer page.
- In the Settings block, in the Logging field, click .
- Uncheck the Collect balancer technical logs checkbox.
- Click Save.
-
In the query output, copy the value of
X-Subject-Token
. -
Open the CLI.
-
Turn off logging for the balancer:
curl --location --request DELETE 'https://<pool>.cloud.api.selcloud.ru/load-balancer/v2/lbaas/loadbalancers/<loadbalancer_uuid>/log_offloading' \
--header 'X-Auth-Token: <x_auth_token>' \
--header 'Content-Type: application/json;charset=utf-8'Specify:
<pool>
— pool where the balancer is located, e.g.ru-8
. Address (URL) depends on the region and pool, you can look in the URL list;<loadbalancer_uuid>
— ID of the load balancer. You can view the ID in control panel: in the top menu click Products → Cloud Servers → Balancers → balancer page → under the balancer name, click ;<x_auth_token>
— The IAM token for the project you copied in step 2.
Get the logs
Use the Get Logs instructions in the Log Platform section.
Look at the description of the log fields for the load balancer.
Log fields
Depending on the type of event, the log displays a different set of fields.
HTTP request
TCP connection
Administrative event