# LoggingDestination

Represents a logging destination for AgentCore Runtime.

Use the static factory methods to create instances:
- `LoggingDestination.cloudWatchLogs(logGroup)` - Send logs to CloudWatch Logs
- `LoggingDestination.s3(bucket)` - Send logs to S3
- `LoggingDestination.firehose(stream)` - Send logs to Kinesis Data Firehose

Obtainable from: LoggingDestination.cloudWatchLogs, LoggingDestination.firehose, LoggingDestination.s3

- Source: [`aws-bedrockagentcore/lib/runtime/observability.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/runtime/observability.ts#L98)
- Type last changed: v2.255.0 · 19 May 2026

## Example

TypeScript:

```ts
const repository = new ecr.Repository(this, 'TestRepository', {
  repositoryName: 'test-agent-runtime',
});

const agentRuntimeArtifact = agentcore.AgentRuntimeArtifact.fromEcrRepository(repository, 'v1.0.0');

// Use a /aws/vendedlogs/ log group for same-account delivery without explicit resource policy
const logGroup = new logs.LogGroup(this, 'RuntimeLogGroup', {
  logGroupName: '/aws/vendedlogs/bedrock-agentcore/my-runtime',
});

new agentcore.Runtime(this, 'test-runtime', {
  runtimeName: 'test_runtime',
  agentRuntimeArtifact: agentRuntimeArtifact,
  tracingEnabled: true,
  loggingConfigs: [
    {
      logType: agentcore.LogType.APPLICATION_LOGS,
      destination: agentcore.LoggingDestination.cloudWatchLogs(logGroup),
    },
  ],
  manageDeliveryResourcePolicy: false,
});
```

Python:

```python
repository = ecr.Repository(self, "TestRepository",
    repository_name="test-agent-runtime"
)

agent_runtime_artifact = agentcore.AgentRuntimeArtifact.from_ecr_repository(repository, "v1.0.0")

# Use a /aws/vendedlogs/ log group for same-account delivery without explicit resource policy
log_group = logs.LogGroup(self, "RuntimeLogGroup",
    log_group_name="/aws/vendedlogs/bedrock-agentcore/my-runtime"
)

agentcore.Runtime(self, "test-runtime",
    runtime_name="test_runtime",
    agent_runtime_artifact=agent_runtime_artifact,
    tracing_enabled=True,
    logging_configs=[agentcore.LoggingConfig(
        log_type=agentcore.LogType.APPLICATION_LOGS,
        destination=agentcore.LoggingDestination.cloud_watch_logs(log_group)
    )
    ],
    manage_delivery_resource_policy=False
)
```

Java:

```java
Repository repository = Repository.Builder.create(this, "TestRepository")
        .repositoryName("test-agent-runtime")
        .build();

AgentRuntimeArtifact agentRuntimeArtifact = AgentRuntimeArtifact.fromEcrRepository(repository, "v1.0.0");

// Use a /aws/vendedlogs/ log group for same-account delivery without explicit resource policy
LogGroup logGroup = LogGroup.Builder.create(this, "RuntimeLogGroup")
        .logGroupName("/aws/vendedlogs/bedrock-agentcore/my-runtime")
        .build();

Runtime.Builder.create(this, "test-runtime")
        .runtimeName("test_runtime")
        .agentRuntimeArtifact(agentRuntimeArtifact)
        .tracingEnabled(true)
        .loggingConfigs(List.of(LoggingConfig.builder()
                .logType(LogType.APPLICATION_LOGS)
                .destination(LoggingDestination.cloudWatchLogs(logGroup))
                .build()))
        .manageDeliveryResourcePolicy(false)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var repository = new Repository(this, "TestRepository", new RepositoryProps {
    RepositoryName = "test-agent-runtime"
});

var agentRuntimeArtifact = AgentRuntimeArtifact.FromEcrRepository(repository, "v1.0.0");

// Use a /aws/vendedlogs/ log group for same-account delivery without explicit resource policy
var logGroup = new LogGroup(this, "RuntimeLogGroup", new LogGroupProps {
    LogGroupName = "/aws/vendedlogs/bedrock-agentcore/my-runtime"
});

new Runtime(this, "test-runtime", new RuntimeProps {
    RuntimeName = "test_runtime",
    AgentRuntimeArtifact = agentRuntimeArtifact,
    TracingEnabled = true,
    LoggingConfigs = new [] { new LoggingConfig {
        LogType = LogType.APPLICATION_LOGS,
        Destination = LoggingDestination.CloudWatchLogs(logGroup)
    } },
    ManageDeliveryResourcePolicy = false
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
repository := ecr.NewRepository(this, jsii.String("TestRepository"), &RepositoryProps{
	RepositoryName: jsii.String("test-agent-runtime"),
})

agentRuntimeArtifact := agentcore.AgentRuntimeArtifact_FromEcrRepository(repository, jsii.String("v1.0.0"))

// Use a /aws/vendedlogs/ log group for same-account delivery without explicit resource policy
logGroup := logs.NewLogGroup(this, jsii.String("RuntimeLogGroup"), &LogGroupProps{
	LogGroupName: jsii.String("/aws/vendedlogs/bedrock-agentcore/my-runtime"),
})

agentcore.NewRuntime(this, jsii.String("test-runtime"), &RuntimeProps{
	RuntimeName: jsii.String("test_runtime"),
	AgentRuntimeArtifact: agentRuntimeArtifact,
	TracingEnabled: jsii.Boolean(true),
	LoggingConfigs: []LoggingConfig{
		&LoggingConfig{
			LogType: agentcore.LogType_APPLICATION_LOGS(),
			Destination: agentcore.LoggingDestination_CloudWatchLogs(logGroup),
		},
	},
	ManageDeliveryResourcePolicy: jsii.Boolean(false),
})
```

## Initializer

TypeScript:

```ts
new LoggingDestination()
```

Python:

```python
LoggingDestination()
```

Java:

```java
new LoggingDestination()
```

C# / .NET:

```csharp
new LoggingDestination()
```

Golang:

```go
NewLoggingDestination()
```

## Methods

- `cloudWatchLogs(logGroup: ILogGroup): LoggingDestination // chainable` (static) — Create a logging destination that sends logs to a CloudWatch Log Group.

  **Parameters**

  - `logGroup` — The CloudWatch Log Group to send logs to.

- `firehose(stream: IDeliveryStream): LoggingDestination // chainable` (static) — Create a logging destination that sends logs to a Kinesis Data Firehose delivery stream.

  **Parameters**

  - `stream` — The Firehose delivery stream to send logs to.

- `s3(bucket: IBucket): LoggingDestination // chainable` (static) — Create a logging destination that sends logs to an S3 bucket.

  **Parameters**

  - `bucket` — The S3 bucket to send logs to.
