After you enable the real-time log delivery feature in the Dynamic Content Delivery Network (DCDN) console, you can deliver logs generated by domain names that are accelerated by DCDN in real time to Log Service for analysis. This topic describes how to enable the real-time log delivery feature.

Prerequisites

  • A DCDN-accelerated domain name is added. For more information, see Add a domain name.
  • Log Service is activated.

Procedure

Important Before you can use a RAM user to enable the real-time log delivery feature, you must grant the required permissions to the RAM user. For more information, see RAM user authorization.
  1. Log on to the DCDN console.
  2. In the left-side navigation pane, choose Data Center > Logs > Real-time Logs.
  3. Enable the real-time log delivery feature.
    The first time you use the real-time log delivery feature, you must enable the feature in the DCDN console. You can follow the on-screen instructions to enable the feature.
  4. Create a delivery project.
    1. On the Real-time Logs page, click Create Delivery Project.
    2. In the Project Information step, configure the parameters and click Next. The following table describes the parameters.
      ParameterFeature
      Project NameThe name of the delivery project. The name must be unique.
      Log TypeThe type of the real-time logs that you want to deliver to Log Service. Valid values:
      • Access Log
      • WAF Interception Log
      Log FieldThe log fields in a real-time log. For more information, see Log fields.
      Sampling RateThe percentage of the number of real-time logs that are delivered to Log Service to the total number of logs.
      Note The number of logs that are delivered to Log Service is calculated by using the following formula: Number of logs that are delivered to Log Service ≈ Total number of logs × Value of Sampling Rate. If you want to deliver all logs, set the Sampling Rate parameter to 100%.
    3. In the Delivery Areas step, configure the parameters and click Next. The following table describes the parameters.
      Important After you create a project to deliver real-time logs, you cannot change the values of the Collected From and Delivered To parameters. If you want to change the values, you must delete the created delivery project and create another delivery project.
      ParameterDescription
      Collected FromThe region from which logs are collected.
      Delivered ToThe region where the Log Service project resides. Log Service creates a project in the specified region to manage real-time logs.
      AuthorizeThe first time you create a delivery project, you must authorize DCDN to assume the AliyunServiceRoleForDCDNRealTimeLogDelivery service-linked role to access Log Service resources. For more information, see SLR for real-time logs.
      Warning Do not revoke permissions from the AliyunServiceRoleForDCDNRealTimeLogDelivery role or delete the role. If you revoke permissions from the role or delete the role, DCDN real-time logs cannot be sent to Log Service.

      After DCDN real-time logs are collected and delivered to Log Service, the logs are stored in the specified region. The following table describes the mappings between the regions from which logs are collected and the regions to which logs are delivered.

      Collected FromDelivered To
      Chinese Mainland
      • China (Hangzhou)
      • China (Shanghai)
      • China (Qingdao)
      • China (Beijing)
      • China (Zhangjiakou)
      • China (Shenzhen)
      EuropeGermany (Frankfurt)
      USUS (Silicon Valley)
      IndiaIndia (Mumbai)
      Other Country/RegionSingapore (Singapore)
    4. In the Domain Names step, select the domain name and click Next.

Related operations

OperationDescription
Disable real-time log delivery for a domain name in a delivery projectAfter you remove a domain name from the delivery project, DCDN no longer delivers the real-time logs of the domain name to Log Service. Procedure:
  1. In the delivery project list, find the delivery project that you want to modify and click Modify in the Actions column.
  2. Click Next to go to the Domain Names step.
  3. Remove the domain name.
  4. Click Next.
Disable real-time log delivery for all domain names in a delivery projectAfter you delete a delivery project, DCDN no longer delivers the real-time logs of the domain names that are associated with the delivery project to Log Service. Procedure:
  1. In the delivery project list, find the delivery project that you want to delete and click Delete in the Actions column.
  2. Click OK.
Important If you delete a delivery project, the project and pushed logs are not automatically deleted. To prevent additional fees, you can delete the corresponding project that is used to store real-time logs in the Log Service console after you delete a delivery project. For more information, see Delete a project.

What to do next

After real-time logs are delivered from DCDN to Log Service, you can query, analyze, download, ship, and transform the logs. You can also create alert rules for the logs. For more information, see Common operations on logs of Alibaba Cloud services.