Configuring Access Logging

After logging is enabled for a bucket, OBS automatically converts bucket logs into objects following the naming rules and writes the objects into a specific bucket.

Procedure

  1. Log in to OBS Console.
  2. In the bucket list, click the target bucket to go to the Summary page.
  3. Click the Logging tab, and select Enable, as shown in Figure 1.

    Figure 1 Logging

  4. Select a bucket from Target Bucket (existing buckets) to store log files. After the target bucket is selected, the ACL read permission and object write permission are automatically assigned.

    You cannot select an Infrequent Access or an Archive bucket for Target Bucket.

  5. Set Target Prefix to specify the prefix for log names.

    After logging is enabled, generated logs are named using the following format:

    <TargetPrefix>YYYY-mm-DD-HH-MM-SS-<UniqueString>

    • <TargetPrefix> indicates the specific target prefix.
    • YYYY-mm-DD-HH-MM-SS indicates the date and time when the log is generated.
    • <UniqueString> indicates a character string generated by OBS.

    In OBS Console, if configured <TargetPrefix> ends with a slash (/), logs generated in the bucket are stored in the <TargetPrefix> folder in the target bucket to facilitate management.

    For example:

    • If the target bucket is bucket and target prefix is bucket-log/, all logs are stored in the bucket-log/ folder in bucket. The log file is named as follows: 2015-06-29-12-22-07-N7MXLAF1BDG7MPDV.
    • If the target bucket is bucket and target prefix is bucket-log, all logs are directly stored in bucket. The log file is named as follows: bucket-log2015-06-29-12-22-07-N7MXLAF1BDG7MPDV.

      After log management is configured, you can view the operation logs in the target bucket that stores the logs in approximately five minutes.

  6. Click OK.

    A message is displayed indicating that log management configuration of the bucket is successful.

Registration