Log Service allows you to download logs to your local host. You can export the logs on the current page (in CSV format) or all logs (in TXT format) to your local computer.

Procedure

  1. Log on to the Log Service console, and then click the target project name.
  2. Click the Logstore management icon icon next to the name of the Logstore, and then select Search & Analysis.
  3. Click the Download icon icon on the right of the Raw Logs tab.
  4. In the Log Download dialog box that appears, select a method to download logs.
    • Select Download Log in Current Page and click OK.Download Log in Current Page

      Save the log on the current page in the comma-separated values (CSV) format.

    • Select Download All Logs with Cloud Shell.Download All Logs with Cloud Shell
      1. Click OK to go to the Cloud Shell command line.
      2. Enter the required information in the command line.
      3. Select a local path and save the log files to the path.
      Note Cloud Shell is deployed in China (Shanghai). If your Logstore does not reside in China (Shanghai), data transfer costs are incurred during downloads. For more information about pricing, click Log Service Pricing in the Notes section.
    • Select Download All Logs Using Command Line Tool.Download All Logs Using Command Line Tool
      1. Install the command line tool. For more information, see User Guide.
      2. Click Security information management to view and copy the AccessKey ID and AccessKey secret of the current user.
      3. If the host on which the command line tool is running resides in the same region as the current project, we recommend that you click Switch to Internal Endpoint. This delivers you a higher download speed and incurs no data transfer cost.
      4. Click Copy Command and replace the AccessKeyId and AccessKeySecret obtained in Step 2 with the AccessKey ID and AccessKey secret of the current user.
      5. Run the command in the command line to download all logs. The logs are saved in a TXT file named download_data.txt under the directory specified in the command line.