class LogDriver
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ECS.LogDriver |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#LogDriver |
![]() | software.amazon.awscdk.services.ecs.LogDriver |
![]() | aws_cdk.aws_ecs.LogDriver |
![]() | aws-cdk-lib » 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.awsLogs({
streamPrefix: 'EventDemo',
mode: ecs.AwsLogDriverMode.NON_BLOCKING,
maxBufferSize: Size.mebibytes(25),
}),
});
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
Container
Definition
Returns
Called when the log driver is configured on a container.
static awsLogs(props)
public static awsLogs(props: AwsLogDriverProps): LogDriver
Parameters
- props
Aws
Log Driver Props
Returns
Creates a log driver configuration that sends log information to CloudWatch Logs.