The real-time log delivery feature allows you to collect logs of accelerated domain names in a region in real time and deliver the logs to Simple Log Service for analysis. This helps you monitor your business and identify service issues efficiently.
Prerequisites
Simple Log Service is activated.
Concepts
Transfer the log data of a domain name to another Logstore: For example, Domain A is associated with Logstore 1 but the log data of Domain A must be transferred to Logstore 2. Before you associate Domain A with Logstore 2, the log data of Domain A is delivered to Logstore 1. After you associate Domain A with Logstore 2, the existing log data of Domain A is transferred from Logstore 1 to Logstore 2. The new log data is directly delivered to Logstore 2. During this process, log delivery is not interrupted.
ImportantBefore you transfer Domain A from Account 1 to Account 2, you must disable real-time log delivery for Domain A in Account 1. After you transfer Domain A to Account 2, you can enable real-time log delivery for Domain A in Account 2. If you do not perform the preceding operations, real-time logs are still delivered to Account 1. This incurs charges to Account 1.
Disable or enable real-time log delivery: You can disable or enable real-time log delivery, disable the delivery of log data to a specific Logstore, and disable the delivery of log data of a specific domain name to Simple Log Service. In the preceding scenarios, the domain name remains associated with the Logstore.
Query log data: You can query data within a specific period of time, all data of a specific visitor, or data delivered to a specific Logstore.
Procedure
Log on to the Alibaba Cloud CDN console.
In the left-side navigation pane, choose .
On the Real-time Logging tab, click Activate Real-Time Log Push Service.
In the Create Real-time Log Delivery Task dialog box, configure the parameters. The following table describes the parameters.
Parameter
Description
Project Name
Enter a name for the Simple Log Service project to which log data of Alibaba Cloud CDN is delivered. The project name must be unique among the projects in the Simple Log Service console.
Logstore Name
A Logstore is a set of resources created in a project. All data in a Logstore originates from the same source. The collected log data is queried, analyzed, and delivered by Logstore. If you do not specify a name for the Logstore, Alibaba Cloud CDN automatically specifies a name for the Logstore.
Region
The region of the Logstore to which logs are delivered.
Log Service Role
After you click Authorize, the Cloud Resource Access Authorization page appears. Click Confirm Authorization Policy to assign the AliyunCDNLogArchiveRole role to Alibaba Cloud CDN.
After the authorization is complete, click Next.
Select domain names that you want to associate with the Logstore and then click Create.
NoteThe log delivery list displays only the Logstore that stores log data of domain names accelerated by Alibaba Cloud CDN. Other Logstores within your Alibaba Cloud account are not displayed in the list.
You can associate up to five domain names with a Logstore.
After log data is delivered to the specified Logstore, the data is presented in four reports. You can access and view these reports in the Alibaba Cloud CDN console.
Click OK.
On the Real-time Log Data tab, you can view the numbers of successful real-time log deliveries and failed real-time log deliveries.
Best practices
For information about the log analysis module of the real-time log delivery feature and typical scenarios of access data analysis, see Best practices for shipping and analyzing Alibaba Cloud CDN real-time logs in Simple Log Service.
Related API operations
You can call API operations to use the real-time log delivery feature. The following table describes the API operations.
Operation | Description |
Enables real-time log delivery for specific domain names. | |
Queries information about real-time log delivery for a domain name. | |
Queries the number of real-time log deliveries. | |
Disables real-time log delivery for specific domain names. | |
Enables real-time log delivery for specific domain names. | |
Queries all domain names for which real-time log delivery is enabled. | |
Modifies the configurations of real-time log delivery for a specific domain name. Each domain name supports only one Logstore. | |
Queries information about real-time log delivery in a region. | |
Deletes the configurations of real-time log delivery for specific domain names. |