forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Jawei, Li <lijiawei5@huawei.com> Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
210 lines
16 KiB
HTML
210 lines
16 KiB
HTML
<a name="EN-US_TOPIC_0125560299"></a><a name="EN-US_TOPIC_0125560299"></a>
|
|
|
|
<h1 class="topictitle1">PUT Bucket logging</h1>
|
|
<div id="body2695266"><p id="EN-US_TOPIC_0125560299__p14750919174016">This operation is used to control access to logs. You can use this operation to grant specific users permission to view or modify bucket logs.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p10831974">This PUT operation uses the <strong id="EN-US_TOPIC_0125560299__b24257400">logging</strong> subresource to set the logging parameters of a bucket. In the current OBS version, only the bucket owner or users granted the <strong id="EN-US_TOPIC_0125560299__b1490210319012">s3:PutBucketLogging</strong> permission can view or modify the bucket logging parameters.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p4974724">By default, logs are not created during bucket creation. The logs for a bucket are created after logging in enabled. To enable logging, configure the log management function in the <strong id="EN-US_TOPIC_0125560299__b129751341124015">LoggingEnabled</strong> request element. You can disable logging using an empty <strong id="EN-US_TOPIC_0125560299__b79754411405">BucketLoggingStatus</strong> request element. To ensure log files are delivered correctly, the log delivery group must also have <strong id="EN-US_TOPIC_0125560299__b18975134114402">WRITE</strong> and <strong id="EN-US_TOPIC_0125560299__b177081483017">READ_ACP</strong> permission for the target bucket which stores logging.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p83424593636">When configuring bucket log management, the owner of the source bucket can specify a target bucket to store logs. The owner of the source bucket can only deliver logs to any bucket of the owner. In the mean time, the target bucket and source bucket must reside in the same region. When uploading a log object, its storage class is set to Standard.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p1357541171216">The traffic consumed by uploading bucket logs is not charged, but it will be reflected in the uplink traffic of the Cloud Eye service.</p>
|
|
<div class="section" id="EN-US_TOPIC_0125560299__section10337547"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560299__screen18556283113232">PUT /?logging HTTP/1.1
|
|
User-Agent: agent
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: date
|
|
Authorization: signatureValue
|
|
|
|
logging configuration</pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560299__section25929063"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0125560299__p2655704">This request involves no parameters.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560299__section32034983"><h4 class="sectiontitle">Request Headers</h4><p id="EN-US_TOPIC_0125560299__p13785496">This request uses common headers. For details about common request headers, see section <a href="en-us_topic_0125560462.html">Common Request Headers</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560299__section13687784426"><h4 class="sectiontitle">Request Elements</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560299__table3648101" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request elements</caption><thead align="left"><tr id="EN-US_TOPIC_0125560299__row50821317"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.9.2.2.4.1.1"><p id="EN-US_TOPIC_0125560299__p22886023">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.9.2.2.4.1.2"><p id="EN-US_TOPIC_0125560299__p41828598">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.9.2.2.4.1.3"><p id="EN-US_TOPIC_0125560299__p32673273">Remarks</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560299__row29289465"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.1 "><p id="EN-US_TOPIC_0125560299__p23636445">BucketLoggingStatus</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.2 "><p id="EN-US_TOPIC_0125560299__p35503886">Indicates the container for logging status information.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p51099518">Type: Container</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.3 "><p id="EN-US_TOPIC_0125560299__p45420300">Mandatory</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560299__row6129524"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.1 "><p id="EN-US_TOPIC_0125560299__p26729467">LoggingEnabled</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.2 "><p id="EN-US_TOPIC_0125560299__p17603181">Indicates the container for logging information. This element is present when you are enabling logging (and not present when you are disabling logging). You can add specific logging information in this element.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p24210907">Type: Container</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.3 "><p id="EN-US_TOPIC_0125560299__p14926427">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560299__row120120"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.1 "><p id="EN-US_TOPIC_0125560299__p9729760">Grant</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.2 "><p id="EN-US_TOPIC_0125560299__p49913109">Indicates the container for the grantee and the grantee's logging permission.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p46564799">Type: Container</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.3 "><p id="EN-US_TOPIC_0125560299__p13652402">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560299__row55762756"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.1 "><p id="EN-US_TOPIC_0125560299__p20489358">Grantee</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.2 "><p id="EN-US_TOPIC_0125560299__p49025284">Indicates the container for users granted logging permission.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p38574380">Type: Container</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.3 "><p id="EN-US_TOPIC_0125560299__p37517072">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560299__row2109335"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.1 "><p id="EN-US_TOPIC_0125560299__p36638467">ID</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.2 "><p id="EN-US_TOPIC_0125560299__p14925884">DomainId of the grantee, Indicates the globally unique ID.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p115233">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.3 "><p id="EN-US_TOPIC_0125560299__p9333879">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560299__row16896051"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.1 "><p id="EN-US_TOPIC_0125560299__p26402881">DisplayName</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.2 "><p id="EN-US_TOPIC_0125560299__p58258620">Indicates the name of the grantee. This element is not globally unique but a user ID corresponds to only one name.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p54565533">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.3 "><p id="EN-US_TOPIC_0125560299__p57732070">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560299__row49826583"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.1 "><p id="EN-US_TOPIC_0125560299__p9421383">Permission</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.2 "><p id="EN-US_TOPIC_0125560299__p24934531">Indicates the logging permission granted to the grantee for a bucket. The bucket owner is automatically granted the <strong id="EN-US_TOPIC_0125560299__b1798523714">FULL_CONTROL</strong> permission when creating the bucket. Logging permission control access to different logs.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p6431156">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560299__p57880412">Valid Values: FULL_CONTROL | READ | WRITE</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.3 "><p id="EN-US_TOPIC_0125560299__p57801815">Optional</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560299__row50454292"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.1 "><p id="EN-US_TOPIC_0125560299__p60265875">TargetBucket</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.2 "><p id="EN-US_TOPIC_0125560299__p49697702">Specifies the target bucket where bucket logs are stored. You can only have your logs delivered to any bucket that you own. User groups that deliver logs to the target bucket must have the <strong id="EN-US_TOPIC_0125560299__b44626139">WRITE</strong> and <strong id="EN-US_TOPIC_0125560299__b66090934">READ_ACP</strong> permission. In OBS, logs of multiple buckets can be stored in the same target bucket. In this case, you need to use different <strong id="EN-US_TOPIC_0125560299__b57947496">TargetPrefix</strong> to distinguish the logs.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p51765418">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.3 "><p id="EN-US_TOPIC_0125560299__p32249323">Mandatory</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560299__row21808451"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.1 "><p id="EN-US_TOPIC_0125560299__p21654113">TargetPrefix</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.2 "><p id="EN-US_TOPIC_0125560299__p9152768">Specifies a prefix for keys of logs to be stored.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p15266056">Type: String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.3 "><p id="EN-US_TOPIC_0125560299__p28590986">Mandatory</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560299__row55992288"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.1 "><p id="EN-US_TOPIC_0125560299__p39081456">TargetGrants</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.2 "><p id="EN-US_TOPIC_0125560299__p11481377">Indicates the container for granting information.</p>
|
|
<p id="EN-US_TOPIC_0125560299__p36223533">Type: Container</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.9.2.2.4.1.3 "><p id="EN-US_TOPIC_0125560299__p48425074">Optional</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560299__section64403877"><h4 class="sectiontitle">Response Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560299__screen7719206113258">HTTP/1.1 status_code
|
|
Server: Server Name
|
|
x-amz-request-id: request id
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
x-amz-id-2: id
|
|
Date: date
|
|
Content-Length: length </pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560299__section42763981"><h4 class="sectiontitle">Response Headers</h4><p id="EN-US_TOPIC_0125560299__p36052622">This response uses common headers. For details about common response headers, see section <a href="en-us_topic_0125560484.html">Common Response Headers</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560299__section49331514"><h4 class="sectiontitle">Response elements</h4><p id="EN-US_TOPIC_0125560299__p49621652">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560299__section41330443"><h4 class="sectiontitle">Error Responses</h4><p id="EN-US_TOPIC_0125560299__p59930847">No special error responses are returned. For details about error responses, see <a href="en-us_topic_0125560440.html#EN-US_TOPIC_0125560440__table30733758">Table 1</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560299__section57475868"><h4 class="sectiontitle">Sample Requests</h4><p id="EN-US_TOPIC_0125560299__p115036619163">Configure the ACL for the target bucket to which logs are delivered</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0125560299__screen366511416504">PUT /?acl HTTP/1.1
|
|
User-Agent: Jakarta Commons-HttpClient/3.1
|
|
Host: bucketname.obs.example.com
|
|
Accept-Encoding: gzip,deflate
|
|
Date: Mon, 27 Sep 2010 01:37:17 GMT
|
|
Authorization: AWS 04RZT432N80TGDF2Y2G2:9uNLINAQ7IOIrD9OnCpDfY2R6nU=
|
|
Content-Length: 598
|
|
|
|
<AccessControlPolicy xmlns="http://obs.example.com/doc/2006-03-01/">
|
|
<Owner>
|
|
<ID>0022A1B8CD8B00000145870549B10002</ID>
|
|
<DisplayName>huangjiang112</DisplayName>
|
|
</Owner>
|
|
<AccessControlList>
|
|
<Grant>
|
|
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
|
|
<ID>0022A1B8CD8B00000145870549B10002</ID>
|
|
<DisplayName>user</DisplayName>
|
|
</Grantee>
|
|
<Permission>FULL_CONTROL</Permission>
|
|
</Grant>
|
|
<Grant>
|
|
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group">
|
|
<URI>http://acs.amazonaws.com/groups/s3/LogDelivery</URI>
|
|
</Grantee>
|
|
<Permission>FULL_CONTROL</Permission>
|
|
</Grant>
|
|
</AccessControlList>
|
|
</AccessControlPolicy></pre>
|
|
<p id="EN-US_TOPIC_0125560299__p45285895164651">Configure logging for the source bucket</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0125560299__screen49065498113317">PUT /?logging HTTP/1.1
|
|
User-Agent: curl/7.19.0
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: date
|
|
Authorization: signatureValue
|
|
Content-Length: 649
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<BucketLoggingStatus xmlns="http://obs.example.com/doc/2006-03-01/">
|
|
<LoggingEnabled>
|
|
<TargetBucket>logging.bucket1</TargetBucket>
|
|
<TargetPrefix>access_log</TargetPrefix>
|
|
<TargetGrants>
|
|
<Grant>
|
|
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
|
|
<ID>af258a3a0a1c2cd93011f75c1e031c043f47a25048490c8742f2f942464794e0</ID>
|
|
<DisplayName>user</DisplayName>
|
|
</Grantee>
|
|
<Permission>FULL_CONTROL</Permission>
|
|
</Grant>
|
|
</TargetGrants>
|
|
</LoggingEnabled>
|
|
</BucketLoggingStatus></pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560299__section47520766"><h4 class="sectiontitle">Sample Responses</h4><p id="EN-US_TOPIC_0125560299__p20793873164719">Set Acl Response</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0125560299__screen25060610165016">HTTP/1.1 200 OK
|
|
x-amz-request-id: 7B6DFC9BC71DD58B061285551605709
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
x-amz-id-2: N0I2REZDOUJDNzFERDU4QjA2MTI4NTU1MTYwNTcwOUFBQUFBQUFBYmJiYmJiYmJD
|
|
Content-Type: text/xml
|
|
Date: Mon, 27 Sep 2010 01:40:03 GMT
|
|
Content-Length: 0</pre>
|
|
<p id="EN-US_TOPIC_0125560299__p14862235164738">Put Logging Response</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0125560299__screen9047660113326">HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-amz-request-id: 7B6DFC9BC71DD58B061285551605709
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
x-amz-id-2: N0I2REZDOUJDNzFERDU4QjA2MTI4NTU1MTYwNTcwOUFBQUFBQUFBYmJiYmJiYmJD
|
|
Date: Mon, 27 Sep 2010 01:40:03 GMT
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0125560493.html">Operations on Buckets</a></div>
|
|
</div>
|
|
</div>
|
|
|