

Sono disponibili altri esempi AWS SDK nel repository [AWS Doc SDK](https://github.com/awsdocs/aws-doc-sdk-examples) Examples. GitHub 

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

# Utilizzare `GetBucketLogging` con una CLI
<a name="s3_example_s3_GetBucketLogging_section"></a>

Gli esempi di codice seguenti mostrano come utilizzare `GetBucketLogging`.

------
#### [ CLI ]

**AWS CLI**  
**Come recuperare lo stato della registrazione di log di un bucket**  
L’esempio `get-bucket-logging` seguente recupera lo stato di registrazione per il bucket specificato.  

```
aws s3api get-bucket-logging \
    --bucket amzn-s3-demo-bucket
```
Output:  

```
{
    "LoggingEnabled": {
        "TargetPrefix": "",
        "TargetBucket": "amzn-s3-demo-bucket-logs"
          }
}
```
+  Per i dettagli sull'API, consulta [GetBucketLogging AWS CLI](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/get-bucket-logging.html)*Command Reference.* 

------
#### [ PowerShell ]

**Strumenti per PowerShell V4**  
**Esempio 1: questo comando restituisce lo stato di registrazione per il bucket specificato.**  

```
Get-S3BucketLogging -BucketName 'amzn-s3-demo-bucket'
```
**Output:**  

```
TargetBucketName   Grants TargetPrefix
----------------   ------ ------------
testbucket1        {}     testprefix
```
+  Per i dettagli sull'API, vedere [GetBucketLogging](https://docs.aws.amazon.com/powershell/v4/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V4). 

**Strumenti per V5 PowerShell **  
**Esempio 1: questo comando restituisce lo stato di registrazione per il bucket specificato.**  

```
Get-S3BucketLogging -BucketName 'amzn-s3-demo-bucket'
```
**Output:**  

```
TargetBucketName   Grants TargetPrefix
----------------   ------ ------------
testbucket1        {}     testprefix
```
+  Per i dettagli sull'API, vedere [GetBucketLogging](https://docs.aws.amazon.com/powershell/v5/reference)in *AWS Strumenti per PowerShell Cmdlet Reference (*V5). 

------