Before you can use Log Service SDK for Go to perform operations on Log Service, you must install Log Service SDK for Go. This topic describes how to install Log Service SDK for Go.

Prerequisites

  • Log Service is activated. For more information, see Activate Log Service.
  • An AccessKey pair is created and obtained. For more information, see AccessKey pair.

    An Alibaba Cloud account has permissions to call all API operations. If you use the AccessKey pair of an Alibaba Cloud account, security risks may occur. We recommend that you create and use a RAM user to call API operations or perform routine O&M. Make sure that the RAM user is granted the permissions to perform operations on Log Service resources. For more information, see Grant permissions to a RAM user.

  • Git and Go are installed. For more information, see Install Git and Install Go.

Install Log Service SDK for Go

Run the following command as an administrator in the command-line interface (CLI) to install Log Service SDK for Go:
go get -u github.com/aliyun/aliyun-log-go-sdk
Note No messages appear during the installation. The installation process requires a few minutes to complete. If the installation fails, run the preceding command again.
If the command is executed and no error is returned, Log Service SDK for Go is installed.

What to do next

Get started with Log Service SDK for Go