This topic describes how to download logs from Log Service to an on-premises host.

Background information

You can use the Log Service console, Cloud Shell, Log Service command line interface (CLI), and SDKs to download logs. Differences between these methods are described in the following table.
Item Log Service console CLI Cloud Shell SDK
Maximum download volume
  • Query: only the first 100 log entries
  • Analysis: all log entries
Hundreds of thousands of log entries Less than and equal to 100,000 log entries Unlimited
Deployment N/A Manual installation Automatic deployment Manual deployment
AccessKey pair N/A Manual configuration Automatic configuration Manual configuration
Download over LAN (no cost for data transfer traffic over Internet) N/A Supported. The Log Service CLI must be deployed in the region where the corresponding Elastic Compute Service (ECS) instance resides. Supported. Cloud Shell must be deployed in the China (Shanghai) region. Supported. The SDK must be deployed in the region where the corresponding ECS instance resides.
Integration with Apsara File Storage NAS N/A Manual configuration Automatic configuration Manual configuration

Procedure

  1. Log on to the Log Service console.
  2. In the Projects section, click the name of the project that you want to view.
  3. Choose Log Storage > Logstores. On the Logstores tab, click the Logstore that you want to view.
  4. In the upper-right corner of the Raw Logs tab, click the Download logs icon.
  5. In the Log Download dialog box, select a method to download logs and click OK.
    • Download Log in Current Page: Download the logs that are displayed on the current page to a file in the comma-separated values (CSV) format.
    • Download All Logs with Cloud Shell: Download all logs as prompted.
      Note The Cloud Shell server resides in the China (Shanghai) region. If you download logs from a Logstore that does not reside in the China (Shanghai) region, you are charged for the traffic of data transfer. For more information, see Log Service pricing.
    • Download All Logs Using Command Line Tool: Download all logs as prompted.
      Note
      • An AccessKey pair is an identity credential that consists of an AccessKey ID and an AccessKey secret. You must set the access-id and access-key parameters in the command based on your AccessKey pair. If you want to use an Alibaba Cloud account to download logs, you can obtain the AccessKey pair of the Alibaba Cloud account in the User Management console. You can also download logs as a Resource Access Management (RAM) user. To do so, create a RAM user. Then, create an AccessKey pair for the RAM user in the RAM console.
      • If the host on which the Log Service CLI is installed resides in the same region as the current project, we recommend that you click Switch to Internal Endpoint. The internal network provides a higher download speed and you are not charged for the download traffic.
      For more information, see Log Service CLI.