# CfnLoggingProps

Properties for defining a `CfnLogging`.

Used as props by: [CfnLogging](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iot.CfnLogging.html)

- Source: Generated at build time
- Type last changed: v2.237.0 · 2 Feb 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_iot as iot } from 'aws-cdk-lib';
const cfnLoggingProps: iot.CfnLoggingProps = {
  accountId: 'accountId',
  defaultLogLevel: 'defaultLogLevel',
  roleArn: 'roleArn',

  // the properties below are optional
  eventConfigurations: [{
    eventType: 'eventType',

    // the properties below are optional
    logDestination: 'logDestination',
    logLevel: 'logLevel',
  }],
};
```

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_iot as iot

cfn_logging_props = iot.CfnLoggingProps(
    account_id="accountId",
    default_log_level="defaultLogLevel",
    role_arn="roleArn",

    # the properties below are optional
    event_configurations=[iot.CfnLogging.EventConfigurationProperty(
        event_type="eventType",

        # the properties below are optional
        log_destination="logDestination",
        log_level="logLevel"
    )]
)
```

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.iot.*;

CfnLoggingProps cfnLoggingProps = CfnLoggingProps.builder()
        .accountId("accountId")
        .defaultLogLevel("defaultLogLevel")
        .roleArn("roleArn")

        // the properties below are optional
        .eventConfigurations(List.of(EventConfigurationProperty.builder()
                .eventType("eventType")

                // the properties below are optional
                .logDestination("logDestination")
                .logLevel("logLevel")
                .build()))
        .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.IoT;

var cfnLoggingProps = new CfnLoggingProps {
    AccountId = "accountId",
    DefaultLogLevel = "defaultLogLevel",
    RoleArn = "roleArn",

    // the properties below are optional
    EventConfigurations = new [] { new EventConfigurationProperty {
        EventType = "eventType",

        // the properties below are optional
        LogDestination = "logDestination",
        LogLevel = "logLevel"
    } }
};
```

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"

cfnLoggingProps := &CfnLoggingProps{
	AccountId: jsii.String("accountId"),
	DefaultLogLevel: jsii.String("defaultLogLevel"),
	RoleArn: jsii.String("roleArn"),

	// the properties below are optional
	EventConfigurations: []interface{}{
		&EventConfigurationProperty{
			EventType: jsii.String("eventType"),

			// the properties below are optional
			LogDestination: jsii.String("logDestination"),
			LogLevel: jsii.String("logLevel"),
		},
	},
}
```

## Properties

- `accountId`: string (required) — The account ID.

- `defaultLogLevel`: string (required) — The default log level.

  Valid Values: `DEBUG | INFO | ERROR | WARN | DISABLED`

- `eventConfigurations`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLogging.EventConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iot.CfnLogging.EventConfigurationProperty.html)[] — Configurations for event-based logging that specifies which event types to log and their logging settings.

  Overrides account-level logging for the specified event

- `roleArn`: string | [IRoleRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_iam.IRoleRef.html) (required) — The role ARN used for the log.
