class LogDrivers
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ECS.LogDrivers |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#LogDrivers |
![]() | software.amazon.awscdk.services.ecs.LogDrivers |
![]() | aws_cdk.aws_ecs.LogDrivers |
![]() | aws-cdk-lib » aws_ecs » LogDrivers |
The base class for log drivers.
Example
declare const secret: ecs.Secret;
// 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({
secretToken: secret,
url: 'my-splunk-url',
}),
});
Initializer
new LogDrivers()
Methods
Name | Description |
---|---|
static aws | Creates a log driver configuration that sends log information to CloudWatch Logs. |
static firelens(props) | Creates a log driver configuration that sends log information to firelens log router. |
static fluentd(props?) | Creates a log driver configuration that sends log information to fluentd Logs. |
static gelf(props) | Creates a log driver configuration that sends log information to gelf Logs. |
static journald(props?) | Creates a log driver configuration that sends log information to journald Logs. |
static json | Creates a log driver configuration that sends log information to json-file Logs. |
static splunk(props) | Creates a log driver configuration that sends log information to splunk Logs. |
static syslog(props?) | Creates a log driver configuration that sends log information to syslog Logs. |
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.
static firelens(props)
public static firelens(props: FireLensLogDriverProps): LogDriver
Parameters
- props
Fire
Lens Log Driver Props
Returns
Creates a log driver configuration that sends log information to firelens log router.
For detail configurations, please refer to Amazon ECS FireLens Examples: https://github.com/aws-samples/amazon-ecs-firelens-examples
static fluentd(props?)
public static fluentd(props?: FluentdLogDriverProps): LogDriver
Parameters
- props
Fluentd
Log Driver Props
Returns
Creates a log driver configuration that sends log information to fluentd Logs.
static gelf(props)
public static gelf(props: GelfLogDriverProps): LogDriver
Parameters
- props
Gelf
Log Driver Props
Returns
Creates a log driver configuration that sends log information to gelf Logs.
static journald(props?)
public static journald(props?: JournaldLogDriverProps): LogDriver
Parameters
- props
Journald
Log Driver Props
Returns
Creates a log driver configuration that sends log information to journald Logs.
static jsonFile(props?)
public static jsonFile(props?: JsonFileLogDriverProps): LogDriver
Parameters
- props
Json
File Log Driver Props
Returns
Creates a log driver configuration that sends log information to json-file Logs.
static splunk(props)
public static splunk(props: SplunkLogDriverProps): LogDriver
Parameters
- props
Splunk
Log Driver Props
Returns
Creates a log driver configuration that sends log information to splunk Logs.
static syslog(props?)
public static syslog(props?: SyslogLogDriverProps): LogDriver
Parameters
- props
Syslog
Log Driver Props
Returns
Creates a log driver configuration that sends log information to syslog Logs.