Updated on 2024-03-26 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

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

The log naming rules are as follows: Start time of the query period-Domain name-Service area.gz. For the service area, cn indicates the Chinese mainland, and ov indicates outside the Chinese mainland. So a typical log name might be, 2018021123-www.example01.com-ov.gz.

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 an hour is too large, it will be divided into multiple files. In this case, a segment flag is added to the name of each log file.

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; en-us; EVA-AL10 Build/HUAWEIEVA-AL10) AppleWebKit/533.1 (KHTML, like Gecko) Mobile Safari/533.1" "bytes=-256"
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

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's version information

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 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

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.