# LoggingConfiguration

Logging configuration for incoming requests.

- Source: [`aws-cloudfront/lib/web-distribution.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-cloudfront/lib/web-distribution.ts#L110)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudfront as cloudfront } from 'aws-cdk-lib';
import { aws_s3 as s3 } from 'aws-cdk-lib';

declare const bucket: s3.Bucket;
const loggingConfiguration: cloudfront.LoggingConfiguration = {
  bucket: bucket,
  includeCookies: false,
  prefix: 'prefix',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_cloudfront as cloudfront
from aws_cdk import aws_s3 as s3

# bucket: s3.Bucket

logging_configuration = cloudfront.LoggingConfiguration(
    bucket=bucket,
    include_cookies=False,
    prefix="prefix"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudfront.*;
import software.amazon.awscdk.services.s3.*;

Bucket bucket;

LoggingConfiguration loggingConfiguration = LoggingConfiguration.builder()
        .bucket(bucket)
        .includeCookies(false)
        .prefix("prefix")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CloudFront;
using Amazon.CDK.AWS.S3;

Bucket bucket;

var loggingConfiguration = new LoggingConfiguration {
    Bucket = bucket,
    IncludeCookies = false,
    Prefix = "prefix"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var bucket Bucket

loggingConfiguration := &LoggingConfiguration{
	Bucket: bucket,
	IncludeCookies: jsii.Boolean(false),
	Prefix: jsii.String("prefix"),
}
```

## Properties

- `bucket`: [IBucket](/cdk/api/v2/docs/aws-cdk-lib.aws_s3.IBucket.html) — Bucket to log requests to.

  **Default:** A logging bucket is automatically created.

- `includeCookies`: boolean = false — Whether to include the cookies in the logs.

- `prefix`: string — Where in the bucket to store logs.

  **Default:** No prefix.
