When you access OSS, a large number of access logs are generated. You can enable logging to facilitate log queries. After you enable and configure logging for a bucket, OSS generates an object on an hourly basis based on the predefined naming conventions. This way, access logs are written to a specified bucket as objects.

Prerequisites

Your account has at least one AccessKey pair.

Procedure

  1. Log on to the OSS console.
  2. Click Buckets, and then click the name of the target bucket.
  3. Choose Logging > Logging.
  4. Click Configure. Set Destination Bucketand Log Prefix.
    • Destination Bucket: Select the name of the bucket in which access logs are to store from the drop-down list. You must be the owner of the selected bucket and the bucket must be in the same region as the bucket for which logging is enabled.
    • Log Prefix: Enter the directory where the access logs are generated and the prefix of the access logs. The access logs are stored in the specified directory. Example: log/<TargetPrefix>. The access logs are stored in the log/ directory.
    Note For more information about the format of access logs and log naming conventions, see Access logging.
  5. Click Save.