aws-cdk-lib.aws_ecs.LogDrivers

class LogDrivers

LanguageType name
.NETAmazon.CDK.AWS.ECS.LogDrivers
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsecs#LogDrivers
Javasoftware.amazon.awscdk.services.ecs.LogDrivers
Pythonaws_cdk.aws_ecs.LogDrivers
TypeScript (source)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

NameDescription
static awsLogs(props)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 jsonFile(props?)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 AwsLogDriverProps

Returns

  • LogDriver

Creates a log driver configuration that sends log information to CloudWatch Logs.


static firelens(props)

public static firelens(props: FireLensLogDriverProps): LogDriver

Parameters

  • props FireLensLogDriverProps

Returns

  • LogDriver

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 FluentdLogDriverProps

Returns

  • LogDriver

Creates a log driver configuration that sends log information to fluentd Logs.


static gelf(props)

public static gelf(props: GelfLogDriverProps): LogDriver

Parameters

  • props GelfLogDriverProps

Returns

  • LogDriver

Creates a log driver configuration that sends log information to gelf Logs.


static journald(props?)

public static journald(props?: JournaldLogDriverProps): LogDriver

Parameters

  • props JournaldLogDriverProps

Returns

  • LogDriver

Creates a log driver configuration that sends log information to journald Logs.


static jsonFile(props?)

public static jsonFile(props?: JsonFileLogDriverProps): LogDriver

Parameters

  • props JsonFileLogDriverProps

Returns

  • LogDriver

Creates a log driver configuration that sends log information to json-file Logs.


static splunk(props)

public static splunk(props: SplunkLogDriverProps): LogDriver

Parameters

  • props SplunkLogDriverProps

Returns

  • LogDriver

Creates a log driver configuration that sends log information to splunk Logs.


static syslog(props?)

public static syslog(props?: SyslogLogDriverProps): LogDriver

Parameters

  • props SyslogLogDriverProps

Returns

  • LogDriver

Creates a log driver configuration that sends log information to syslog Logs.