You can log in to the COS Console to enable logging for a bucket so that COS logs various requests related to bucket operations. This feature can help you use and manage your buckets better. For more information, see Logging Overview.
- Currently, COS logging is available in Beijing, Shanghai, Guangzhou, Chengdu, and Toronto regions.
- Currently, only the bucket owner has permission to set logging, with the *Logging panel invisible to other users in the console.
- Logs are shipped every 5 minutes. As COS doesn’t guarantee logs are 100% correct, they are for reference only, and cannot serve as a basis for billing.
- Log in to the COS Console, click Bucket List in the left sidebar, and then the bucket for which to enable logging.
- Select the Advanced Configuration tab, find the Logging section, and click Edit.
- Toggle on the Status button to begin the configuration.
- Configure the log shipping information as follows:
- Destination Bucket: the *source bucket * for which logging is enabled and the *destination bucket * that stores the logs must be in the same region. It is not recommended to use the source bucket itself as the destination bucket.
- Target prefix: a custom path prefix for easy log search. If not specified, it defaults to the root path of the destination bucket.
- Service Authorization: you need to authorize the CLS service to ship logs to your bucket.
- Click Save to enable logging.
Note that it may take minutes or longer to ship logs to your destination bucket.
- Now, you can view your logs in the destination bucket you configured to save logs.
- To enable logging, you need to create a log role in the CAM Console, and grant it read/write permission on the logs in the destination bucket.
- When logging is disabled, if the log role is not deleted, its read/write permission on the logs in the destination bucket will not be revoked.