You can view health check logs generated in the last three days on the Health Check Logs page. To view earlier log data, you must download the log files from the Object Storage Service (OSS) bucket in which the health check logs are stored.

Store health check logs

You can view the health check logs of Classic Load Balancer (CLB) backend servers by using the log storage feature of CLB. CLB retains only health check logs generated in the last three days. To retain health check logs for a longer period of time, you can store them in an OSS bucket.

You can enable or disable the log storage feature anytime. After the log storage feature is enabled, CLB creates a folder named AliyunSLBHealthCheckLogs in the selected bucket to store the log files of health checks. Health check logs of CLB instances are generated on an hourly basis. The system automatically creates subfolders to store the log files and names the subfolders based on the date on which the logs are generated. For example, 20220907.

The log files are named based on the time at which they are generated. For example, the log file generated from 00:00 to 01:00 is named 01.txt, and the log file generated from 01:00 to 02:00 is named 02.txt.

Note Health check logs are generated only when the health status of a backend server is abnormal. Health check logs are generated on an hourly basis. If no exceptions are detected on the backend server within an hour, no health check logs are generated for that hour.

Prerequisites

Step 1: Create a bucket

Make sure that the bucket and the CLB instance are deployed in the same region.

  1. Log on to the OSS console.
  2. In the left-side navigation pane, click Buckets. On the Buckets page, click Create Bucket.
  3. In the Create Bucket panel, configure the parameters and click OK.
    For more information, see Create buckets.
    Parameter Description
    Bucket Name The name of the bucket. The name of a bucket cannot be changed after the bucket is created.

    The name must meet the following conventions:

    • The name of a bucket must be unique in OSS in an Alibaba Cloud account.
    • The name can contain only lowercase letters, digits, and hyphens (-).
    • The name must start and end with a lowercase letter or a digit.
    • The name must be 3 to 63 characters in length.
    Region The region where the bucket is located. The region of a bucket cannot be changed after the bucket is created.

    To access the bucket from an Elastic Compute Service (ECS) instance over an internal network, select the region in which the ECS instance is located. For more information, see OSS domain names.

    Important If the bucket that you want to create is located in a region in the Chinese mainland, you must complete real-name registration by submitting your information on the Real-name Registration page.
    Zone-redundant Storage OSS provides zone-redundant storage (ZRS) to replicate user data across three zones within the same region. If one zone becomes unavailable, you can continue to access the data that is stored in the other two zones.
    • Activate: If you enable ZRS for the bucket, objects in the bucket are stored by using ZRS. For example, if the storage class of the bucket is Standard, the objects in the bucket are Standard ZRS objects by default. For more information, see ZRS.
      Important ZRS is supported only in the following regions: China (Shenzhen), China (Beijing), China (Hangzhou), China (Shanghai), China (Hong Kong), Singapore (Singapore), and Indonesia (Jakarta). You are charged extra fees for ZRS. This feature cannot be disabled after it is enabled. Exercise caution when you enable this feature.
    • Not Activated: By default, ZRS is disabled for the bucket. If ZRS is disabled for a bucket to be created, objects in the bucket are stored by using locally redundant storage (LRS). For example, if the storage class of the bucket is Standard, the objects in the bucket are Standard LRS objects by default.

Step 2: Authorize CLB to access OSS

After you create a bucket, you must authorize the SLBLogDefaultRole role of CLB to access OSS resources.

Important Authorization is required only when you configure log storage for the first time.
  1. Log on to the CLB console.
  2. In the left-side navigation pane, choose CLB (FKA SLB) > Logs > Health Check Logs.
  3. On the Health Check Logs page, click the Log Storage tab.
  4. On the Log Storage tab, click 1: Activate OSS.
  5. After OSS is activated, click Activate Now in the 2. Authorize the required RAM role section.
  6. On the Cloud Resource Access Authorization page, read the authorization description and click Confirm Authorization Policy.
  7. Log on to the Resource Access Management (RAM) console.
  8. In the left-side navigation pane, choose Identities > Roles, find SLBLogDefaultRole, and then click Add Permissions.
  9. In the Add Permissions panel, set Select Policy to System Policy, select the AliyunOSSFullAccess policy from the list, and then click OK.
  10. Click Complete.

Step 3: Configure log storage

  1. Log on to the CLB console.
  2. In the left-side navigation pane, choose CLB (FKA SLB) > Logs > Health Check Logs.
  3. On the Health Check Logs page, click the Log Storage tab.
  4. On the Log Storage tab, find the region and click Configure Log Storage.
  5. In the Configure Log Storage panel, configur the following parameters and click OK.
    Parameter Description
    Bucket Select a bucket to store the log files.
    Log Type Select a log type. In this example, Health Check Log is selected.
  6. On the Log Storage tab, turn on the switch in the Status column to enable the log storage feature.

View health check logs

You can view health check logs generated in the last three days in the CLB console.

  1. Log on to the CLB console.
  2. In the left-side navigation pane, choose Logs > Health Check Logs.
  3. On the Health Check Logs page, click the Logs tab.
    Note Health check logs are generated only when the health status of a backend server is abnormal. Health check logs are generated on an hourly basis. If no exceptions are detected on the backend server within an hour, no health check logs are generated for that hour.
    • If the entry SLB_instance_IP:port to Added_ECS_instance_IP:port abnormal; cause:XXX is displayed in the health check log, the health status of the backend server is abnormal. Troubleshoot based on the detailed error message.
    • If the entry SLB_instance_IP:port to Added_ECS_instance_IP:port normal is displayed in the health check log, the health status of the backend server becomes normal again.

Download health check logs

You can download health check logs of CLB instances in the OSS console.

  1. Log on to the OSS console.
  2. In the left-side navigation pane, click Buckets. On the page that appears, click the name of the bucket that you want to query.
  3. In the left-side navigation pane, choose Files > Objects. On the Objects page, click the AliyunSLBHealthCheckLogs/ folder.
  4. Click the log entry that you want to download. In the View Details panel, click Download under the URL to download logs.