本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
啟用 Amazon S3 伺服器存取記錄日誌
伺服器存取記錄,針對向 Amazon S3 儲存貯體提出的請求,提供詳細的記錄。伺服器存取日誌對許多應用程式來說,都是個很有用的資料。舉例來說,存取記錄資訊在安全與存取稽核中相當實用。這些資訊也可幫助您了解自己的客戶群,並掌握 Amazon S3 帳單相關資料。
Amazon S3 預設不會收集伺服器存取日誌。啟用記錄後,Amazon S3 會將來源儲存貯體的存取日誌交付給您所選擇的目的地儲存貯體 (也稱為目標儲存貯體)。目的地值區必須位於相同 AWS 區域 以及 AWS 帳戶 作為源桶。
存取日誌記錄包含對儲存貯體提出要求,內有詳細資訊。這資訊可能包含要求類型、要求中指定的資源,以及要求的處理時間和日期。如需記錄基本概念的詳細資訊,請參閱 使用伺服器存取記錄記錄要求。
重要
-
啟用 Amazon S3 儲存貯體的伺服器存取記錄日誌無須額外付費。不過,系統提供給您的任何日誌檔都會產生一般儲存費用 (您隨時都可刪除日誌檔)。我們不會評估日誌檔傳遞的資料傳輸費,但會收取存取日誌檔的一般資料傳輸費率。
-
您的目的地儲存貯體不應啟用伺服器存取記錄。您可將日誌交付給所有您擁有的儲存貯體,在同一的區域當做來源儲存貯體,包括來源儲存貯體本身。不過,將日誌交付至來源儲存貯體會導致日誌的無限迴圈,因此不建議這樣做。為了更簡易進行記錄管理,建議您將存取記錄儲存在不同的儲存貯體中。如需詳細資訊,請參閱 如何啟用日誌交付?
-
已啟用 S3 物件鎖定的 S3 儲存貯體不能用作伺服器存取日誌的目的地儲存貯體。目的地儲存貯體不得具有預設保留期組態。
-
目的地儲存貯體不得啟用「請求者付款」。
-
只有在使用 Amazon S3 受管金鑰 (SSE-S3) (使用 256 位元進階加密標準 (-256) 的伺服器端加密時,才能在目的地儲存貯體上使用預設儲存貯體加密。AES預設伺服器端加密 AWS Key Management Service (AWS KMS) 鍵 (SSE-KMS) 不受支援。
您可以使用 Amazon S3 主控台 Amazon S3,啟用或停用伺服器存取記錄 API AWS Command Line Interface (AWS CLI),或 AWS SDKs.
日誌交付許可
Amazon S3 使用特殊日誌交付帳戶來寫入伺服器存取日誌。這些寫入受一般的存取控制限制之約束。對於存取日誌交付,您必須將目的地儲存貯體存取權授予記錄服務主體 (logging.s3.amazonaws.com
)。
若要授與 Amazon S3 以進行日誌交付的許可,您可以使用儲存貯體政策或儲存貯體存取控制清單 (ACLs),視目的地儲存貯體的 S3 物件擁有權設定而定。不過,我們建議您改用值區政策ACLs。
S3 物件擁有權的儲存貯體擁有者強制執行設定
如果目的地值區使用「物件擁有權」的「值區擁有者強制執行」設定,ACLs則會停用且不再影響權限。在此情況下,您必須更新目的地儲存貯體的儲存貯體政策,以授予記錄服務主體的存取權。您無法更新儲存貯體ACL以授與 S3 日誌交付群組的存取權。您也不能將目的地授予(也稱為目標授權)包含在您的 PutBucketLogging 組態。
如需將存取記錄傳送的現有值區ACLs遷移至值區政策的相關資訊,請參閱授予 S3 日誌交付群組的存取權以進行伺服器存取日誌記錄。如需「物件擁有權」的詳細資訊,請參閱 控制物件的擁有權並停ACLs用值區。當您建立新值區時,ACLs依預設會停用。
使用儲存貯體政策授予存取權
若要使用目的地儲存貯體上的儲存貯體政策授予存取權,請更新儲存貯體政策以將 s3:PutObject
許可授予記錄服務主體。如果您使用 Amazon S3 主控台來啟用伺服器存取記錄,則主控台會自動更新目的地儲存貯體上的儲存貯體政策,以將此許可授予記錄服務主體。如果您以程式設計方式啟用伺服器存取記錄,則必須手動更新目的地儲存貯體的儲存貯體政策,以將存取權授予記錄服務主體。
如需將存取權授予記錄服務主體的範例儲存貯體政策,請參閱 使用儲存貯體政策授予記錄服務主體的許可。
使用值區授予存取權 ACLs
您也可以使用值區ACLs來授與存取記錄傳送的存取權。您可以將授與項目新增至儲存貯體ACL,以READ_ACP
授WRITE
與 S3 日誌傳遞群組和許可。不過,不建議使用儲存貯體授與 S3 日誌傳遞群組ACLs的存取權。如需詳細資訊,請參閱控制物件的擁有權並停ACLs用值區。如需將存取記錄傳送的現有值區ACLs遷移至值區政策的相關資訊,請參閱授予 S3 日誌交付群組的存取權以進行伺服器存取日誌記錄。如需授與ACL記錄服務主體存取權的範例,請參閱使用值區將權限授與記錄傳遞群組 ACL。
使用儲存貯體政策授予記錄服務主體的許可
此範例儲存貯體政策會將 s3:PutObject
許可授予記錄服務主體 (logging.s3.amazonaws.com
)。若要使用此儲存貯體政策,請以您自己的資訊取代
。在下列原則中,user input placeholders
是將傳送伺服器存取記錄的目的地儲存貯體,並且amzn-s3-demo-destination-bucket
是來源儲存貯體。 amzn-s3-demo-source-bucket
是您要用於記錄物件的選擇性目的地前置詞 (也稱為目標前置詞)。 EXAMPLE-LOGGING-PREFIX
是 AWS 帳戶 擁有源存儲桶。SOURCE-ACCOUNT-ID
注意
如果您的儲存貯體政策中有 Deny
陳述式,請確保它們不會阻止 Amazon S3 交付存取日誌。
{ "Version": "2012-10-17", "Statement": [ { "Sid": "S3ServerAccessLogsPolicy", "Effect": "Allow", "Principal": { "Service": "logging.s3.amazonaws.com" }, "Action": [ "s3:PutObject" ], "Resource": "arn:aws:s3:::
amzn-s3-demo-destination-bucket
/EXAMPLE-LOGGING-PREFIX
*", "Condition": { "ArnLike": { "aws:SourceArn": "arn:aws:s3:::amzn-s3-demo-source-bucket
" }, "StringEquals": { "aws:SourceAccount": "SOURCE-ACCOUNT-ID
" } } } ] }
使用值區將權限授與記錄傳遞群組 ACL
注意
作為安全最佳實務,Amazon S3 預設會在所有新儲存貯體中停用存取控制清單 (ACLs)。如需 Amazon S3 主控台中ACL許可的詳細資訊,請參閱配置 ACLs。
雖然我們不建議使用這種方法,但是您可以使用值區將權限授與記錄傳遞群組ACL。不過,如果目的地值區使用「值區擁有者強制執行物件擁有權」的設定,您就無法設定值區或物件ACLs。您也不能將目的地授予(也稱為目標授權)包含在您的 PutBucketLogging 組態。反之,您必須使用儲存貯體政策,授予記錄服務主體 (logging.s3.amazonaws.com
) 的存取權。如需詳細資訊,請參閱日誌交付許可。
在值區中ACL,記錄傳遞群組會以下列項目表示URL:
http://acs.amazonaws.com/groups/s3/LogDelivery
若要授WRITE
與和 READ_ACP
(ACL讀取) 權限,請將下列授權新增至目的地值區ACL:
<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>WRITE</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>READ_ACP</Permission> </Grant>
如需以程式設計方式新增ACL授權的範例,請參 配置 ACLs
重要
當您使用啟用 Amazon S3 伺服器存取記錄時 AWS CloudFormation 在儲存貯體上,且您用ACLs來授與 S3 日誌傳遞群組的存取權,您還必須將 "新增AccessControl": "LogDeliveryWrite"
至 CloudFormation 範本。這樣做很重要,因為您只能透過為值區建立ACL值區來授與這些權限,但無法在中ACLs為值區建立自訂 CloudFormation。您只能使用罐ACLs裝 CloudFormation。
啟用伺服器存取日誌記錄
若要使用 Amazon S3 主控台 Amazon S3 啟用伺服器存取記錄 RESTAPI, AWS SDKs,以及 AWS CLI,請使用下列程序。
登入 AWS Management Console 並在打開 Amazon S3 控制台https://console.aws.amazon.com/s3/
。 -
在 Buckets (儲存貯體) 清單中,選擇要啟用伺服器存取記錄日誌的儲存貯體名稱。
-
選擇 Properties (屬性)。
-
在 Server access logging (伺服器存取記錄日誌) 區段中,選擇 Edit (編輯)。
-
在伺服器存取記錄下,選擇啟用。
-
在目的地儲存貯體下,指定儲存貯體和選用的字首。如果您指定字首,建議您在字首後面加上正斜線 (
/
),以便更容易找到日誌。注意
指定包含斜線 (
/
) 的字首,可讓您更容易找到日誌物件。例如,若指定的字首值為logs/
,則 Amazon S3 建立的每個日誌物件都會以logs/
字首作為其索引鍵的開頭,如下所示:logs/2013-11-01-21-32-16-E568B2907131C0C0
如果您指定字首值
logs
,則日誌物件會顯示如下:logs2013-11-01-21-32-16-E568B2907131C0C0
-
在日誌物件索引鍵格式下,執行下列其中一項操作:
-
要選擇 non-date-based 分區,請選擇 [DestinationPrefixYYYY] []-[MM]-[DD]-[hh]-[毫米]-[ss]-[UniqueString]。
-
要選擇以日期為基礎的分區,請選擇 [DestinationPrefixSourceAccountIdSourceRegion] [SourceBucket]/[YYYY]/[]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString],然後選擇 S3 事件時間或記錄檔傳遞時間。
-
-
選擇 Save changes (儲存變更)。
在儲存貯體上啟用伺服器存取記錄時,主控台會啟用來源儲存貯體上的記錄,同時更新目的地儲存貯體的儲存貯體政策,以將
s3:PutObject
許可授予記錄服務主體 (logging.s3.amazonaws.com
)。如需此儲存貯體政策的詳細資訊,請參閱 使用儲存貯體政策授予記錄服務主體的許可。您可以在目的地儲存貯體中檢視日誌。啟用伺服器存取記錄後,可能需要好幾個小時才能將記錄傳遞到目標儲存貯體中。如需如何以及何時交付日誌的詳細資訊,請參閱 交付日誌的方式?。
如需詳細資訊,請參閱檢視 S3 儲存貯體的屬性。
若要啟用記錄,請提交 PutBucketLogging請求在源存儲桶上添加日誌配置。請求會指定目的地儲存貯體 (也稱為目標儲存貯體),以及選擇性地指定要搭配所有日誌物件索引鍵使用的字首。
下列範例會識別
為目的地值區,amzn-s3-demo-destination-bucket
作為前綴。日誌/
<BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/2006-03-01"> <LoggingEnabled> <TargetBucket>
amzn-s3-demo-destination-bucket
</TargetBucket> <TargetPrefix>logs/
</TargetPrefix> </LoggingEnabled> </BucketLoggingStatus>
下列範例會識別
為目的地值區,amzn-s3-demo-destination-bucket
做為前置詞,並日誌/
EventTime
做為記錄物件索引鍵格式。
<BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/2006-03-01"> <LoggingEnabled> <TargetBucket>
amzn-s3-demo-destination-bucket
</TargetBucket> <TargetPrefix>logs/
</TargetPrefix> <TargetObjectKeyFormat> <PartitionedPrefix> <PartitionDateSource>EventTime</PartitionDateSource> </PartitionedPrefix> </TargetObjectKeyFormat> </LoggingEnabled> </BucketLoggingStatus>
日誌物件由 S3 日誌交付帳戶寫入並擁有,且已為儲存貯體擁有者授予日誌物件的完整許可。您可以選擇使用目的地授權 (也稱為目標授權) 將許可授予其他使用者,讓他們能夠存取日誌。如需詳細資訊,請參閱 PutBucketLogging.
注意
如果目的地儲存貯體使用「物件擁有權」的儲存貯體擁有者強制執行設定,則您無法使用目的地授權將許可授予其他使用者。若要將許可授予其他人,您可以在目的地儲存貯體上更新儲存貯體政策。如需詳細資訊,請參閱日誌交付許可。
若要擷取值區上的記錄組態,請使用 GetBucketLoggingAPI操作。
若要刪除記錄組態,請傳送包含空白 BucketLoggingStatus
的 PutBucketLogging
請求:
<BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/2006-03-01"> </BucketLoggingStatus>
若要在儲存貯體上啟用記錄功能,您可以使用 Amazon S3 API 或 AWS SDK包裝程式庫。
下列範例會在儲存貯體上啟用記錄。您必須建立兩個儲存貯體,一個來源儲存貯體與一個目的地 (目標) 儲存貯體。範例會先更新目的地值區ACL上的值區。然後將必要的許可授予日誌交付群組,以將日誌寫入目的地儲存貯體,接著再啟用來源儲存貯體上的記錄。
這些範例不適用於使用「物件擁有權」之儲存貯體擁有者強制執行設定的目的地儲存貯體。
如果目的地 (目標) 值區使用物件擁有權的值區擁有者強制設定,您就無法設定值區或物件ACLs。您也無法在PutBucketLogging設定中包含目的地 (目標) 授與。您必須使用儲存貯體政策授予日誌記錄服務主體 (logging.s3.amazonaws.com
) 的存取權。如需詳細資訊,請參閱日誌交付許可。
我們建議您在每個記錄值區中建立專用的記錄值區 AWS 區域 你有 S3 存儲桶在. 然後將 Amazon S3 存取日誌交付至該 S3 儲存貯體。如需詳細資訊和範例,請參閱 put-bucket-logging
如果目的地 (目標) 值區使用物件擁有權的值區擁有者強制設定,您就無法設定值區或物件ACLs。您也無法在PutBucketLogging設定中包含目的地 (目標) 授與。您必須使用儲存貯體政策授予日誌記錄服務主體 (logging.s3.amazonaws.com
) 的存取權。如需詳細資訊,請參閱日誌交付許可。
範例 — 對跨兩個區域的五個儲存貯體啟用存取日誌
在此範例中,您擁有下列五個儲存貯體:
-
1-amzn-s3-demo-bucket1-us-east-1
-
2-amzn-s3-demo-bucket1-us-east-1
-
3-amzn-s3-demo-bucket1-us-east-1
-
1-amzn-s3-demo-bucket1-us-west-2
-
2-amzn-s3-demo-bucket1-us-west-2
注意
下列程序的最後一個步驟提供範例 bash 指令碼,您可以使用這些指令碼建立記錄儲存貯體,並在這些儲存貯體上啟用伺服器存取記錄。若要使用這些指令碼,您必須建立 policy.json
和 logging.json
檔案,如下列程序所述。
-
在美國西部 (奧勒岡) 和美國東部 (維吉尼亞北部) 區域建立兩個記錄目的地儲存貯體,並為其命名如下:
-
amzn-s3-demo-bucket1-logs-us-east-1
-
amzn-s3-demo-bucket1-logs-us-west-2
-
-
稍後在這些步驟中,您將啟用伺服器存取記錄,如下所示:
-
1-amzn-s3-demo-bucket1-us-east-1
記錄到 S3 儲存貯體amzn-s3-demo-bucket1-logs-us-east-1
,帶有字首1-amzn-s3-demo-bucket1-us-east-1
-
2-amzn-s3-demo-bucket1-us-east-1
記錄到 S3 儲存貯體amzn-s3-demo-bucket1-logs-us-east-1
,帶有字首2-amzn-s3-demo-bucket1-us-east-1
-
3-amzn-s3-demo-bucket1-us-east-1
記錄到 S3 儲存貯體amzn-s3-demo-bucket1-logs-us-east-1
,帶有字首3-amzn-s3-demo-bucket1-us-east-1
-
1-amzn-s3-demo-bucket1-us-west-2
記錄到 S3 儲存貯體amzn-s3-demo-bucket1-logs-us-west-2
,帶有字首1-amzn-s3-demo-bucket1-us-west-2
-
2-amzn-s3-demo-bucket1-us-west-2
記錄到 S3 儲存貯體amzn-s3-demo-bucket1-logs-us-west-2
,帶有字首2-amzn-s3-demo-bucket1-us-west-2
-
-
對於每個目的地記錄值區,請使用值區ACL或值區政策授與伺服器存取記錄傳送的權限:
-
更新儲存貯體政策 (建議) - 若要將許可授予記錄服務主體,請使用下列
put-bucket-policy
命令:取代
使用您的目標存儲桶的名稱。amzn-s3-demo-destination-bucket
-日誌aws s3api put-bucket-policy --bucket
--policy file://policy.jsonamzn-s3-demo-destination-bucket
-logsPolicy.json
是目前資料夾中的JSON文件,其中包含下列值區政策。若要使用此儲存貯體政策,請以您自己的資訊取代
。在下列政策中,user input placeholders
是將傳送伺服器存取記錄的目的地值區,並且amzn-s3-demo-destination-bucket
-日誌
是來源值區。amzn-s3-demo-source-bucket
是 AWS 帳戶 擁有源存儲桶。SOURCE-ACCOUNT-ID
{ "Version": "2012-10-17", "Statement": [ { "Sid": "S3ServerAccessLogsPolicy", "Effect": "Allow", "Principal": { "Service": "logging.s3.amazonaws.com" }, "Action": [ "s3:PutObject" ], "Resource": "arn:aws:s3:::
amzn-s3-demo-destination-bucket
-logs
/*", "Condition": { "ArnLike": { "aws:SourceArn": "arn:aws:s3:::amzn-s3-demo-source-bucket
" }, "StringEquals": { "aws:SourceAccount": "SOURCE-ACCOUNT-ID
" } } } ] } -
更新儲存貯體 ACL — 若要授與 S3 日誌傳遞群組的許可,請使用下列
put-bucket-acl
命令。Replace (取代)
使用您的目標(目標)存儲桶的名稱。amzn-s3-demo-destination-bucket
-日誌aws s3api put-bucket-acl --bucket
--grant-write URI=http://acs.amazonaws.com/groups/s3/LogDelivery --grant-read-acp URI=http://acs.amazonaws.com/groups/s3/LogDeliveryamzn-s3-demo-destination-bucket
-logs
-
-
然後建立包含記錄組態的
logging.json
檔案 (根據以下三個範例之一)。建立logging.json
檔案之後,您可以使用下列put-bucket-logging
命令套用記錄組態。Replace (取代)
使用您的目標(目標)存儲桶的名稱。amzn-s3-demo-destination-bucket
-日誌aws s3api put-bucket-logging --bucket
--bucket-logging-status file://logging.jsonamzn-s3-demo-destination-bucket
-logs注意
您可以使用下一個步驟中提供的其中一個 bash 指令碼,在每一個目的地儲存貯體上套用記錄組態,而不要使用此
put-bucket-logging
命令。若要使用這些指令碼,您必須建立policy.json
和logging.json
檔案,如此程序中所述。該文
logging.json
件是當前JSON文件夾中的文檔,其中包含您的日誌配置。如果目的地儲存貯體使用「物件擁有權」的儲存貯體擁有者強制執行設定,則您的記錄組態無法包含目的地 (目標) 授權。如需詳細資訊,請參閱日誌交付許可。範例 -
logging.json
,沒有目的地 (目標) 授權以下範例
logging.json
檔案不包含目的地 (目標) 授權。因此,您可以將此組態套用至使用「物件擁有權」的儲存貯體擁有者強制執行設定的目的地 (目標) 儲存貯體。{ "LoggingEnabled": { "TargetBucket": "
amzn-s3-demo-destination-bucket
-logs
", "TargetPrefix": "amzn-s3-demo-destination-bucket
/" } }範例 -
logging.json
,有目的地 (目標) 授權以下範例
logging.json
檔案包含目的地 (目標) 授權。如果目的地值區使用「值區擁有者強制執行物件擁有權」設定,您就無法在 PutBucketLogging 組態。如需詳細資訊,請參閱日誌交付許可。
{ "LoggingEnabled": { "TargetBucket": "
amzn-s3-demo-destination-bucket
-logs
", "TargetPrefix": "amzn-s3-demo-destination-bucket
/", "TargetGrants": [ { "Grantee": { "Type": "AmazonCustomerByEmail", "EmailAddress": "user@example.com
" }, "Permission": "FULL_CONTROL" } ] } }範例 -
logging.json
,其日誌物件索引鍵格式設定為 S3 事件時間下列
logging.json
檔案會將日誌物件索引鍵格式變更為 S3 事件時間。如需設定日誌物件索引鍵格式的詳細資訊,請參閱 如何啟用日誌交付?。{ "LoggingEnabled": { "TargetBucket": "
amzn-s3-demo-destination-bucket
-logs
", "TargetPrefix": "amzn-s3-demo-destination-bucket
/", "TargetObjectKeyFormat": { "PartitionedPrefix": { "PartitionDateSource": "EventTime" } } } } -
使用下列其中一個 bash 指令碼,在您的帳戶中為所有儲存貯體新增存取記錄。Replace (取代)
使用您的目標(目標)存儲桶的名稱,並amzn-s3-demo-destination-bucket
-日誌
替換為您的存儲桶所在的區域的名稱。us-west-2
注意
只在您的所有儲存貯體都位在相同區域時,此指令碼才能運作。若您的儲存貯體位於多個區域,您必須調整指令碼。
範例 – 授予儲存貯體的存取權,並為您的帳戶中的儲存貯體新增日誌記錄
loggingBucket='
amzn-s3-demo-destination-bucket
-logs
' region='us-west-2
' # Create the logging bucket. aws s3 mb s3://$loggingBucket --region $region aws s3api put-bucket-policy --bucket $loggingBucket --policy file://policy.json # List the buckets in this account. buckets="$(aws s3 ls | awk '{print $3}')" # Put a bucket logging configuration on each bucket. for bucket in $buckets do # This if statement excludes the logging bucket. if [ "$bucket" != "$loggingBucket" ] ; then continue; fi printf '{ "LoggingEnabled": { "TargetBucket": "%s", "TargetPrefix": "%s/" } }' "$loggingBucket" "$bucket" > logging.json aws s3api put-bucket-logging --bucket $bucket --bucket-logging-status file://logging.json echo "$bucket done" done rm logging.json echo "Complete"範例 — 使用存儲桶授予訪問權限,ACLs並為帳戶中的存儲桶添加日誌記錄
loggingBucket='
amzn-s3-demo-destination-bucket
-logs
' region='us-west-2
' # Create the logging bucket. aws s3 mb s3://$loggingBucket --region $region aws s3api put-bucket-acl --bucket $loggingBucket --grant-write URI=http://acs.amazonaws.com/groups/s3/LogDelivery --grant-read-acp URI=http://acs.amazonaws.com/groups/s3/LogDelivery # List the buckets in this account. buckets="$(aws s3 ls | awk '{print $3}')" # Put a bucket logging configuration on each bucket. for bucket in $buckets do # This if statement excludes the logging bucket. if [ "$bucket" != "$loggingBucket" ] ; then continue; fi printf '{ "LoggingEnabled": { "TargetBucket": "%s", "TargetPrefix": "%s/" } }' "$loggingBucket" "$bucket" > logging.json aws s3api put-bucket-logging --bucket $bucket --bucket-logging-status file://logging.json echo "$bucket done" done rm logging.json echo "Complete"
驗證您的伺服器存取日誌設定
啟用伺服器存取記錄之後,請完成以下步驟:
-
存取目的地儲存貯體,並驗證是否正在交付日誌檔。設定存取日誌後,Amazon S3 會立即開始擷取請求並記錄請求。不過,記錄檔可能需要幾個小時才會傳送至目的地值區。如需詳細資訊,請參閱 儲存貯體記錄狀態變更會在一段時間後生效 和 伺服器日誌交付最佳作法。
您也可以使用 Amazon S3 請求指標,並為這些指標設定 Amazon CloudWatch 警示,自動驗證日誌交付。如需詳細資訊,請參閱使用 Amazon 監控指標 CloudWatch。
-
驗證您是否能夠開啟和讀取日誌檔的內容。
如需伺服器存取記錄疑難排解資訊,請參閱 針對伺服器存取記錄進行疑難排解。