Log Service provides multiple log collection methods. Before using Log Service, you must make the following preparations.

Procedure

  1. Activate Log Service.

    Log on to the Log Service product page with your registered Alibaba Cloud account and click Get it Free. The system automatically redirects to the purchase page. Select the I agree with Log Service Agreement of Service check box and then click Enable Now. The Log Service console appears.

  2. Create and enable an AccessKey for using the API or SDK of Log Service.

    An AccessKey is required to use Log Service through its API or SDK. Before using Log Service, you must create an AccessKey.

    In the Log Service console, move the pointer over your username in the upper-right corner, and then select accessekeys from the drop-down list. In the dialog box that appears, click Continue to manage AccessKey. On the Security Management page, click Create AccessKey. After the AccessKey is created, ensure that its status is Enable.

    Create and enable an AccessKey
  3. Create a project.
    If you log on to the Log Service console for the first time, the system prompts you to create a project. You can also click Create Project in the Projects section to create a project.

    You can modify the description of a project or delete a project. For more information, see Manage projects.

    Figure 1. Create a project
    Create a project
  4. Create a Logstore.
    After a project is created, the system prompts you to create a Logstore. You can also click the project name to go to the project overview page, and click the plus sign (+) next to the search box under Logstores to create a Logstore. When creating a Logstore, you must specify how to use these logs.

    You can also modify or delete a Logstore. For more information, see Manage a Logstore.

    Create a Logstore
  5. (Optional) Manage shards.
    When creating a Logstore, you can specify the number of shards based on the volume and generation speed of your logs. You can also merge and split shards when modifying a Logstore. If you have turned on the Automatic Sharding switch, you do not need to manually set the number of shards. Log Service automatically sets the number of shards based on the current data read/write speed.

    For more information about how to merge and split shards, see Manage shards.

  6. (Optional) Grant permissions.
    To collect logs of other Alibaba Cloud services or deliver Log Service data to other services such as Object Storage Service (OSS) for storage and analysis, you must grant the relevant permissions to Log Service or other Alibaba Cloud Services.

    You can also grant permissions to Resource Access Management (RAM) users so that you can use Log Service through RAM users.

    For more information about permission policies and authorization procedures, see Authorization - Overview.