When you access OSS, a large number of access logs are generated. Real-time log query combines OSS with Log Service. This feature allows you to query OSS access logs in the console to collect access statistics, audit access to OSS, track exceptions, and troubleshoot problems. Real-time log query can improve your efficiency and help you make better decisions based on real-time data.
Prerequisites
- Log Service is activated.
You can activate Log Service on the Log Service product page.
- Log Service is authorized to access OSS.
You can go to the Cloud Resource Access Authorization page to authorize Log Service to access OSS.
Background information
- Real-time log query allows you to query logs from the past seven days free of charge. If the log retention time that you set is longer than seven days, Log Service charges the fees for the excess days. Extra fees are charged when you read data from or write data to Log Service over the Internet.
- Log Service allows you to store 900 GB of logs (equivalent to 900 million 1-KB log entries) per day free of charge, and charges fees for excess logs.
For more information about the billing standards, see Log Service Billing methods.
Enable real-time log query
You can use one of the following methods to enable real-time log query:
Method 1: Enable real-time log query when you create a bucket
Method 2: Enable real-time log query on the overview page of a bucket
- Log on to the OSS console.
- Click Buckets, and then click the name of the target bucket.
- Choose .
- Click Activate Now.
Real-time log query allows you to query logs from the past seven days free of charge. You can click Config Log Retention Time in the upper-right corner to modify the retention time of logs.
Query real-time logs
You can use one of the following methods to query real-time logs:
Method 1: Query real-time logs on the Original Log page
Method 2: Query real-time logs on the Dashboard page
Method 3: Query real-time logs in the Log Service console
You can view OSS access logs in the Log Service console. For more information, see OSS access logs.
Disable real-time log query
You can disable real-time log query if you
- Log on to the OSS console.
- Click Buckets, and then click the name of the target bucket.
- Choose .
- Click Disable Real-time Log Query in the upper-right corner.
References
- For more information about log query, see Real-time log query in the Developer Guide.
- For more information about OSS logging, see Configure logging.