# FluentdLogDriverProps

Specifies the fluentd log driver configuration options.

[Source](https://docs.docker.com/config/containers/logging/fluentd/)

Extends: [BaseLogDriverProps](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.BaseLogDriverProps.html)
Used as props by: [FluentdLogDriver](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.FluentdLogDriver.html)
Used as argument in: [LogDrivers.fluentd](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.LogDrivers.html#fluentd)

- Source: [`aws-ecs/lib/log-drivers/fluentd-log-driver.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ecs/lib/log-drivers/fluentd-log-driver.ts#L14)
- Type last changed: v2.190.0 · 17 Apr 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_ecs as ecs } from 'aws-cdk-lib';
const fluentdLogDriverProps: ecs.FluentdLogDriverProps = {
  address: 'address',
  async: false,
  asyncConnect: false,
  bufferLimit: 123,
  env: ['env'],
  envRegex: 'envRegex',
  labels: ['labels'],
  maxRetries: 123,
  retryWait: cdk.Duration.minutes(30),
  subSecondPrecision: false,
  tag: 'tag',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk
from aws_cdk import aws_ecs as ecs

fluentd_log_driver_props = ecs.FluentdLogDriverProps(
    address="address",
    async=False,
    async_connect=False,
    buffer_limit=123,
    env=["env"],
    env_regex="envRegex",
    labels=["labels"],
    max_retries=123,
    retry_wait=cdk.Duration.minutes(30),
    sub_second_precision=False,
    tag="tag"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.ecs.*;

FluentdLogDriverProps fluentdLogDriverProps = FluentdLogDriverProps.builder()
        .address("address")
        .async(false)
        .asyncConnect(false)
        .bufferLimit(123)
        .env(List.of("env"))
        .envRegex("envRegex")
        .labels(List.of("labels"))
        .maxRetries(123)
        .retryWait(Duration.minutes(30))
        .subSecondPrecision(false)
        .tag("tag")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.ECS;

var fluentdLogDriverProps = new FluentdLogDriverProps {
    Address = "address",
    Async = false,
    AsyncConnect = false,
    BufferLimit = 123,
    Env = new [] { "env" },
    EnvRegex = "envRegex",
    Labels = new [] { "labels" },
    MaxRetries = 123,
    RetryWait = Duration.Minutes(30),
    SubSecondPrecision = false,
    Tag = "tag"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

fluentdLogDriverProps := &FluentdLogDriverProps{
	Address: jsii.String("address"),
	Async: jsii.Boolean(false),
	AsyncConnect: jsii.Boolean(false),
	BufferLimit: jsii.Number(123),
	Env: []*string{
		jsii.String("env"),
	},
	EnvRegex: jsii.String("envRegex"),
	Labels: []*string{
		jsii.String("labels"),
	},
	MaxRetries: jsii.Number(123),
	RetryWait: cdk.Duration_Minutes(jsii.Number(30)),
	SubSecondPrecision: jsii.Boolean(false),
	Tag: jsii.String("tag"),
}
```

## Properties

- `address`: string — By default, the logging driver connects to localhost:24224.

  **Default:** address not set.

  Supply the
  address option to connect to a different address. tcp(default) and unix
  sockets are supported.

- `async`: boolean = false — Docker connects to Fluentd in the background.

  Messages are buffered until
  the connection is established.

- `asyncConnect`: boolean = false — use `async` instead

  Messages are buffered until
  the connection is established.

- `bufferLimit`: number — The amount of data to buffer before flushing to disk.

  **Default:** The amount of RAM available to the container.

- `env`: string[] — The env option takes an array of keys.

  **Default:** No env

  If there is collision between
  label and env keys, the value of the env takes precedence. Adds additional fields
  to the extra attributes of a logging message.

- `envRegex`: string — The env-regex option is similar to and compatible with env.

  **Default:** No envRegex

  Its value is a regular
  expression to match logging-related environment variables. It is used for advanced
  log tag options.

- `labels`: string[] — The labels option takes an array of keys.

  **Default:** No labels

  If there is collision
  between label and env keys, the value of the env takes precedence. Adds additional
  fields to the extra attributes of a logging message.

- `maxRetries`: number — The maximum number of retries.

  **Default:** 4294967295 (2**32 - 1).

- `retryWait`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — How long to wait between retries.

  **Default:** 1 second

- `subSecondPrecision`: boolean = false — Generates event logs in nanosecond resolution.

- `tag`: string — By default, Docker uses the first 12 characters of the container ID to tag log messages.

  **Default:** The first 12 characters of the container ID

  Refer to the log tag option documentation for customizing the
  log tag format.
