Access Logging
Scenarios
The requests sent to DNS Resolver are logged in detail, such as the time when a request was sent, client IP address, request path, and server response.
Constraints
LTS is a regional service. You can only enable access logging for the DNS service in the following regions: CN Southwest-Guiyang1, AP-Jakarta, AP-Singapore, AF-Johannesburg, TR-Istanbul, and LA-Sao Paulo1.
To enable access logging, you need to interconnect DNS with LTS and create a log group and a log stream on the LTS console. For details, see the Log Tank Service User Guide.
Configuring LTS
- Create a log group.
- Log in to the management console.
- Click on the upper left and select the desired region and project.
- In the upper left corner of the page, click and choose Management & Governance > Log Tank Service.
- In the navigation pane on the left, choose Log Management.
- Click Create Log Group. In the displayed dialog box, enter a name for the log group.
Set Log Retention Duration as needed.
- Confirm the settings and click OK.
- Create a log stream.
- On the LTS console, click on the left of the target log group.
- Click Create Log Stream. In the displayed dialog box, enter a name for the log stream.
- Select an enterprise project as needed.
- Confirm the settings and click OK.
Configuring Access Logging
- Go to the Resolvers page.
- Click on the upper left and select the desired region and project.
- Click the Access Logs tab.
- Click Configure Access Logging.
- Configure the parameters, such as Log Group, Log Stream, and VPC, as prompted.
- Click OK.
Viewing Access Logs
- Go to the Resolvers page.
- Click on the upper left and select the desired region and project.
- Click the Access Logs tab.
- In the access log list, locate the target access log and click View Log Details.
On the displayed page, view the information about the log group and log stream.
- Click the name of the log stream and view its details.
The following is an example log. For details about the fields in the log, see Table 1. The log format cannot be modified.
{ "content": "2024-07-02 09:28:00.304 baidu.com. A NOERROR TCP cnsouthwest2d _ 192.168.0.138 c1e159ce-ac25-4908-8e31-8ff73ad2f57d", "_resource_id": "c1e159ce-ac25-4908-8e31-8ff73ad2f57d", "_resource_name": "c1e159ce-ac25-4908-8e31-8ff73ad2f57d", "_service_type": "DNS", "category": "LTS", "collectTime": 1719883683977 }
Table 1 Fields in a DNS Resolver access log Field
Description
Value Description
Example Value
content
DNS Resolver access logs
String
2024-07-02 09:28:00.304 baidu.com. A NOERROR TCP cnsouthwest2d _ 192.168.0.138 c1e159ce-ac25-4908-8e31-8ff73ad2f57d
_resource_id
Resource ID
UUID
95c2b814-99dc-939a-e811-ae84c61ea9ee
_resource_name
Resource name
Name of the resource specified by the resource ID
95c2b814-99dc-939a-e811-ae84c61ea9ee
_service_type
Service for which access logs are collected
Fixed value: DNS
DNS
category
Log category
Fixed value: LTS
LTS
collectTime
LTS log collection time
Integer
1704158708902
Configuring Log Transfer
If you want to analyze access logs later, transfer the logs to OBS for storage.
- Log in to the management console.
- Click on the upper left and select the desired region and project.
- In the upper left corner of the page, click and choose Management & Governance > Log Tank Service.
- In the navigation pane on the left, choose Log Transfer.
- In the upper right corner of the Log Transfer page, click Configure Log Transfer.
Figure 1 Configuring log transfer
- Configure the parameters. For details, see the Log Tank Service User Guide.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot