interface GenericLogDriverProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ECS.GenericLogDriverProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#GenericLogDriverProps |
Java | software.amazon.awscdk.services.ecs.GenericLogDriverProps |
Python | aws_cdk.aws_ecs.GenericLogDriverProps |
TypeScript (source) | aws-cdk-lib » aws_ecs » GenericLogDriverProps |
The configuration to use when creating a log driver.
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: new ecs.GenericLogDriver({
logDriver: 'fluentd',
options: {
tag: 'example-tag',
},
}),
});
Properties
Name | Type | Description |
---|---|---|
log | string | The log driver to use for the container. |
options? | { [string]: string } | The configuration options to send to the log driver. |
secret | { [string]: Secret } | The secrets to pass to the log configuration. |
logDriver
Type:
string
The log driver to use for the container.
The valid values listed for this parameter are log drivers that the Amazon ECS container agent can communicate with by default.
For tasks using the Fargate launch type, the supported log drivers are awslogs and splunk. For tasks using the EC2 launch type, the supported log drivers are awslogs, syslog, gelf, fluentd, splunk, journald, and json-file.
For more information about using the awslogs log driver, see Using the awslogs Log Driver in the Amazon Elastic Container Service Developer Guide.
options?
Type:
{ [string]: string }
(optional, default: the log driver options.)
The configuration options to send to the log driver.
secretOptions?
Type:
{ [string]:
Secret
}
(optional, default: no secret options provided.)
The secrets to pass to the log configuration.