# LogDrivers

The base class for log drivers.

- Source: [`aws-ecs/lib/log-drivers/log-drivers.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-ecs/lib/log-drivers/log-drivers.ts#L23)
- Type last changed: v2.235.0 · 15 Jan 2026

## Example

```ts
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

```ts
new LogDrivers()
```

## Methods

- `awsLogs(props: AwsLogDriverProps): LogDriver` (static) — Creates a log driver configuration that sends log information to CloudWatch Logs.

- `firelens(props: FireLensLogDriverProps): LogDriver` (static) — 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

- `fluentd(props?: FluentdLogDriverProps): LogDriver` (static) — Creates a log driver configuration that sends log information to fluentd Logs.

- `gelf(props: GelfLogDriverProps): LogDriver` (static) — Creates a log driver configuration that sends log information to gelf Logs.

- `journald(props?: JournaldLogDriverProps): LogDriver` (static) — Creates a log driver configuration that sends log information to journald Logs.

- `jsonFile(props?: JsonFileLogDriverProps): LogDriver` (static) — Creates a log driver configuration that sends log information to json-file Logs.

- `none(): LogDriver` (static) — Creates a log driver configuration that disables logging (Docker `none` driver).

- `splunk(props: SplunkLogDriverProps): LogDriver` (static) — Creates a log driver configuration that sends log information to splunk Logs.

- `syslog(props?: SyslogLogDriverProps): LogDriver` (static) — Creates a log driver configuration that sends log information to syslog Logs.
