class LogDriver
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ECS.LogDriver |
Java | software.amazon.awscdk.services.ecs.LogDriver |
Python | aws_cdk.aws_ecs.LogDriver |
TypeScript (source) | @aws-cdk/aws-ecs » LogDriver |
Implemented by
Aws, Fire, Fluentd, Gelf, Generic, Journald, Json, Splunk, Syslog
Obtainable from
Log.awsLogs(), Log.firelens(), Log.fluentd(), Log.gelf(), Log.journald(), Log.jsonFile(), Log.splunk(), Log.syslog()
The base class for log drivers.
Example
// Create a Task Definition for the container to start
const taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');
taskDefinition.addContainer('TheContainer', {
image: ecs.ContainerImage.fromRegistry('example-image'),
memoryLimitMiB: 256,
logging: ecs.LogDrivers.splunk({
token: SecretValue.secretsManager('my-splunk-token'),
url: 'my-splunk-url',
}),
});
Initializer
new LogDriver()
Methods
| Name | Description |
|---|---|
| bind(scope, containerDefinition) | Called when the log driver is configured on a container. |
| static aws | Creates a log driver configuration that sends log information to CloudWatch Logs. |
bind(scope, containerDefinition)
public bind(scope: Construct, containerDefinition: ContainerDefinition): LogDriverConfig
Parameters
- scope
Construct - containerDefinition
ContainerDefinition
Returns
Called when the log driver is configured on a container.
static awsLogs(props)
public static awsLogs(props: AwsLogDriverProps): LogDriver
Parameters
- props
AwsLog Driver Props
Returns
Creates a log driver configuration that sends log information to CloudWatch Logs.

.NET
Java
Python
TypeScript (