Set logging

Last Updated: Jul 29, 2017

You can enable or disable logging for a bucket through the console. You can store logs in the same logging-enabled bucket or a new bucket. For more information about the bucket logging format, refer to Set access logging.

Operation procedure

  1. Go to the OSS Console.
  2. Select a bucket to open the bucket overview page.
  3. Select Bucket Properties > Logging.
  4. In the Log Bucket drop-down list, select the name of a bucket to store the logs. Only buckets of the same user and region can be selected. To disable logging, select No Bucket.
  5. In the Log Prefix text box, type the prefix of the log name, that is, <TargetPrefix> in the logging naming conventions below.
  6. Click Set to save the logging setting.

Logging naming conventions

The following is the naming conventions for the access log record:<TargetPrefix><SourceBucket>YYYY-MM-DD-HH-MM-SS-<UniqueString>

  • <TargetPrefix>: indicates the log prefix specified by the user.
  • <SourceBucket>: indicates the name of the source bucket.
  • YYYY-MM-DD-HH-MM-SS: indicates the time when the log is created. YYYY indicates the year, MM indicates the month, DD indicates the day, HH indicates the hour, MM indicates the minute, and SS indicates the second.
  • <UniqueString>: indicates the string generated by the OSS.

An example object name used to store OSS access logs is as follows:
In the above example, MyLog is the log prefix specified by the user, oss-example is the name of the source bucket, 2015-09-10-04-00-00 is the log creation time, and 0000 is the string generated by the OSS.

Thank you! We've received your feedback.