Cloud load balancer logs
Logging is only available for load balancers in the pool ru-8.
The service is used for logging the load balancer Logging Platform. More details on the principle of operation and the cost of the service in the instructions General information about the Log Platform service.
The following types of events are logged for the load balancer:
- HTTP request;
- TCP connection;
- administrative event — change server status in target group.
Depending on the type of event, a different set is recorded for the event fields.
To collect load balancer logs, you need to enable logging for the balancer. Get the logs can only be done through the API. If you no longer need to collect logs, you can deactivate 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 the existing balancer.
Enable logging for an existing load balancer
Logging uses some of the balancer's computational resources.
Control panel
OpenStack API
- in control panels from the top menu, press Products and select Cloud servers.
- Go to the section Balancers → tab Balancers.
- Open the balancer page.
- In the block Settings in the field Logging click .
- Check the box Collect technical logs of the balancer.
- 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 is created.
-
In the query output, copy the value
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, e.g.ru-8
. The address (URL) depends on the region and pool, you can look in the URL list;<loadbalancer_uuid>
— Balancer ID. You can view the ID in control panels: from the top menu, press Products → Cloud servers → Balancers → balancer page → under the balancer's name, tap ;<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 Principle of operation instructions General information about the Log Platform service.
Disable logging for the load balancer
Control panel
OpenStack API
- in control panels from the top menu, press Products and select Cloud servers.
- Go to the section Balancers → tab Balancers.
- Open the balancer page.
- In the block Settings in the field Logging click .
- Uncheck the box Collect technical logs of the balancer.
- Click Save.
-
In the query output, copy the value
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
. The address (URL) depends on the region and pool, you can look in the URL list;<loadbalancer_uuid>
— Balancer ID. You can view the ID in control panels: from the top menu, press Products → Cloud servers → Balancers → balancer page → under the balancer's name, tap ;<x_auth_token>
— The IAM token for the project you copied in step 2.
Get the logs
Use the instructions Get the logs In the Log Platform section.
Look at the description 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