Overview
You can log in to the Cloud Object Storage (COS) console to enable the log storage feature for your bucket. The log storage feature provided by COS can record various request logs related to bucket operations. Enabling the log storage feature can help you better manage and utilize your bucket. For more information about log storage, please refer to Logging Overview. Note:
Currently, the log storage feature of COS supports regions including Beijing, Nanjing, Shanghai, Guangzhou, Chengdu, Chongqing, Shenzhen Finance, Shanghai Finance, Hong Kong (China), Singapore, Seoul, Bangkok, Tokyo, Silicon Valley, Virginia, and Frankfurt.
Currently, only the bucket owner has permission to set Logging, and other users cannot see the Logging configuration item in the console.
COS does not guarantee 100% accuracy of log data, which is for reference only and not used as the basis for measurement or billing.
Directions
2. In the left navigation bar, click Bucket List to enter the bucket list management page.
3. Find the source bucket for which you want to enable log storage, click the Bucket Name, and enter the bucket management page.
4. On the left sidebar, select Logging > Logging, click Edit, and toggle on the feature.
5. Configure the configuration items of Logging as follows.
Destination Bucket: The destination bucket that stores the source bucket's logs must reside in the same region as the source bucket. We recommend you not set the source bucket itself as the destination bucket.
Path Prefix: A custom path prefix for the logs. If this field is left empty, logs will be delivered to the root directory of the destination bucket.
Service Authorization: When enabling the log storage feature for the first time, you need to authorize the CLS product service to deliver access logs to your bucket. Follow the prompts to complete the authorization.
6. After confirming that everything is correct, click Save.
Note:
After enabling the log storage feature, it is expected to take 1 hour to complete the first batch of log delivery. Subsequently, logs will be generated every 5 minutes, and the specific time of log delivery depends on the data volume.
7. Go to the destination bucket configured to view the generated logs.
8. After downloading the logs, you can view them in detail. For more information, see Logging Overview. Notes
To enable Logging, you need to create a log role in the CAM console and grant the role permissions to read/write logs of the source bucket.
If Logging is disabled yet the role is not deleted, the role's read/write permissions on the source bucket's logs still exist.