Viewing L7 load balancer logs
You can configure the delivery of L7 load balancer logs to a Yandex Cloud Logging log group.
To view L7 Load balancer logs:
- In the management console
, select the folder the load balancer is in. - Go to Application Load Balancer.
- Select the load balancer to view logs for.
- Navigate to the Logs tab.
- Select the number of messages per page and the time interval: 1 hour, 3 hours, 1 day, 1 week, 2 weeks.
- To see the message details, click the arrow icon on its left.
You can also view logs in Yandex Cloud Logging:
- In the management console
, select the folder with the log group. - Go to Cloud Logging.
- Select the log group receiving your load balancer logs.
- Select the number of messages per page and the time interval: 1 hour, 3 hours, 1 day, 1 week, 2 weeks.
- To see the message details, click the arrow icon on its left.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
To view the entries in JSON format, run this command:
yc logging read \
--group-name=<log_group_name> \
--format=json
Where:
--group-name: Name of the log group receiving your load balancer logs.--format: Log output format.
Result:
[
{
"uid": "488ece3c-75b8-4d35-95ac-2b49********",
"resource": {},
"timestamp": "2021-06-22T02:10:40Z",
"ingested_at": "2021-06-22T08:49:15.716Z",
"saved_at": "2021-06-22T08:49:16.176097Z",
"level": "INFO",
"message": "My message",
"json_payload": {
"request_id": "1234"
}
}
]
For more information on how to view logs with CLI, see this article.
To view log group messages, use the LogReadingService/Read gRPC API call.