Updated on 2024-10-29 GMT+08:00

Log Management

CDN records the requests to all domain names including those deleted. If you have enabled the enterprise project function, log management is not available for these deleted domain names. You can download logs for a specific period over the past 30 days. Then you can analyze the access to your service resources in detail.

Log Description

Log delay: Most logs are generated in 24 hours. Download them after they are generated.

Due to the synchronization latency of the log system, user access logs may not be generated in the first hour after a domain name is connected to CDN. To view logs generated in this period, submit a service ticket.

Log naming: Period start time-Acceleration domain name-Extended field.gz

Log generation: By default, a log file is generated for each domain name every hour, and 24 log files are generated every day. The size of a log file is limited. If a log file generated within a period is too large, it will be divided into multiple files, with an extended field added to their names.

Example of log file content
[05/Feb/2018:07:54:52 +0800] x.x.x.x 1 "-" "HTTP/1.1" "GET" "www.test.com" "/test/1234.apk" 206 720 HIT "Mozilla/5.0 (Linux; U; Android 6.0; zh-cn; EVA-AL10 Build/HUAWEIEVA-AL10) AppleWebKit/533.1 (KHTML, like Gecko) Mobile Safari/533.1" "bytes=-256" x.x.x.x
Table 1 describes each field (from left to right) in the log.
Table 1 Description of a CDN log file

No.

Field Description

Example

1

Log generation time

[05/Feb/2018:07:54:52 +0800]

2

Access IP address (client IP address)

x.x.x.x

3

Time to last byte (ms)

1

4

Referer information

-

5

HTTP protocol identifier

HTTP/1.1

6

HTTP request method

GET

7

Acceleration domain name

www.test.com

8

Requested path (excluding URL parameters)

/test/1234.apk

9

HTTP status code

206

10

Response size (bytes)

720

11

Cache hit status

HIT

12

User-Agent information, which helps servers recognize the OS, OS version, CPU, browser, and browser version

Mozilla/5.0 (Linux; U; Android 6.0; en-us; EVA-AL10 Build/HUAWEIEVA-AL10) AppleWebKit/533.1 (KHTML, like Gecko) Mobile Safari/533.1

13

Range information. It specifies the positions of the first and last bytes for the data to be returned.

bytes can be expressed by the following three methods:

  • bytes=x-y: requesting content from the xth to yth byte.
  • bytes=-y: requesting content from the last y bytes.
  • bytes=x-: requesting content from the xth to the last byte.

bytes=-256

14

Server IP address, that is, the IP address used by the CDN server to send responses

x.x.x.x

Downloading Logs

  1. Log in to Huawei Cloud console. Choose Service List > Content Delivery & Edge Computing > Content Delivery Network.

    The CDN console is displayed.

  2. In the navigation pane, choose Logs.
  3. Select the acceleration domain name and specify the time range for the query.

    All logs of the specified time range are displayed in the log list. If no requests are received within the period queried, no logs are generated and no data is displayed on the page.

    Figure 1 Log management
  4. Click Download in the row of the desired log to download the log file to a local computer.