> **Experimental**
>
> `@aws-cdk/aws-redshift-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# CloudWatchLoggingOptions

Options for CloudWatch logging.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/cluster.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-redshift-alpha/lib/cluster.ts#L157)
- Type last changed: v2.273.0-alpha.0 · 9 Oct 2026

## Example

TypeScript:

```ts
import * as ec2 from 'aws-cdk-lib/aws-ec2';
import { ClusterLogging, LogExport } from '@aws-cdk/aws-redshift-alpha';

declare const vpc: ec2.IVpc;

const cluster = new Cluster(this, 'Redshift', {
  masterUser: {
    masterUsername: 'admin',
  },
  vpc,
  logging: ClusterLogging.cloudWatch({
    logExports: [LogExport.CONNECTION_LOG, LogExport.USER_LOG],
  }),
});
```

Python:

```python
from aws_cdk.aws_redshift_alpha import Login
import aws_cdk.aws_ec2 as ec2
from aws_cdk.aws_redshift_alpha import ClusterLogging, LogExport

# vpc: ec2.IVpc

cluster = Cluster(self, "Redshift",
    master_user=Login(
        master_username="admin"
    ),
    vpc=vpc,
    logging=ClusterLogging.cloud_watch(
        log_exports=[LogExport.CONNECTION_LOG, LogExport.USER_LOG]
    )
)
```

Java:

```java
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.redshift.alpha.ClusterLogging;
import software.amazon.awscdk.services.redshift.alpha.LogExport;

IVpc vpc;

Cluster cluster = Cluster.Builder.create(this, "Redshift")
        .masterUser(Login.builder()
                .masterUsername("admin")
                .build())
        .vpc(vpc)
        .logging(ClusterLogging.cloudWatch(CloudWatchLoggingOptions.builder()
                .logExports(List.of(LogExport.CONNECTION_LOG, LogExport.USER_LOG))
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Redshift.Alpha
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.Redshift.Alpha;

IVpc vpc;

var cluster = new Cluster(this, "Redshift", new ClusterProps {
    MasterUser = new Login {
        MasterUsername = "admin"
    },
    Vpc = vpc,
    Logging = ClusterLogging.CloudWatch(new CloudWatchLoggingOptions {
        LogExports = new [] { LogExport.CONNECTION_LOG, LogExport.USER_LOG }
    })
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkredshiftalpha/v2
import ec2 "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdkredshiftalpha"

var vpc IVpc

cluster := awscdkredshiftalpha.NewCluster(this, jsii.String("Redshift"), &ClusterProps{
	MasterUser: &Login{
		MasterUsername: jsii.String("admin"),
	},
	Vpc: Vpc,
	Logging: awscdkredshiftalpha.ClusterLogging_CloudWatch(&CloudWatchLoggingOptions{
		LogExports: []LogExport{
			awscdkredshiftalpha.LogExport_CONNECTION_LOG,
			awscdkredshiftalpha.LogExport_USER_LOG,
		},
	}),
})
```

## Properties

- `logExports`: [LogExport](/cdk/api/v2/docs/@aws-cdk_aws-redshift-alpha.LogExport.html)[] — The types of logs to export.

  **Default:** [LogExport.CONNECTION_LOG, LogExport.USER_LOG, LogExport.USER_ACTIVITY_LOG]
