aws-cdk-lib.aws_ecs.GelfLogDriverProps

interface GelfLogDriverProps

LanguageType name
.NETAmazon.CDK.AWS.ECS.GelfLogDriverProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsecs#GelfLogDriverProps
Javasoftware.amazon.awscdk.services.ecs.GelfLogDriverProps
Pythonaws_cdk.aws_ecs.GelfLogDriverProps
TypeScript (source)aws-cdk-lib » aws_ecs » GelfLogDriverProps

Specifies the journald log driver configuration options.

Source

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.gelf({ address: 'my-gelf-address' }),
});

Properties

NameTypeDescription
addressstringThe address of the GELF server.
compressionLevel?numberUDP Only The level of compression when gzip or zlib is the gelf-compression-type.
compressionType?GelfCompressionTypeUDP Only The type of compression the GELF driver uses to compress each log message.
env?string[]The env option takes an array of keys.
envRegex?stringThe env-regex option is similar to and compatible with env.
labels?string[]The labels option takes an array of keys.
tag?stringBy default, Docker uses the first 12 characters of the container ID to tag log messages.
tcpMaxReconnect?numberTCP Only The maximum number of reconnection attempts when the connection drop.
tcpReconnectDelay?DurationTCP Only The number of seconds to wait between reconnection attempts.

address

Type: string

The address of the GELF server.

tcp and udp are the only supported URI specifier and you must specify the port.


compressionLevel?

Type: number (optional, default: 1)

UDP Only The level of compression when gzip or zlib is the gelf-compression-type.

An integer in the range of -1 to 9 (BestCompression). Higher levels provide more compression at lower speed. Either -1 or 0 disables compression.


compressionType?

Type: GelfCompressionType (optional, default: gzip)

UDP Only The type of compression the GELF driver uses to compress each log message.

Allowed values are gzip, zlib and none.


env?

Type: string[] (optional, default: No env)

The env option takes an array of keys.

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?

Type: string (optional, default: No envRegex)

The env-regex option is similar to and compatible with env.

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


labels?

Type: string[] (optional, default: No labels)

The labels option takes an array of keys.

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.


tag?

Type: string (optional, default: The first 12 characters of the container ID)

By default, Docker uses the first 12 characters of the container ID to tag log messages.

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


tcpMaxReconnect?

Type: number (optional, default: 3)

TCP Only The maximum number of reconnection attempts when the connection drop.

A positive integer.


tcpReconnectDelay?

Type: Duration (optional, default: 1)

TCP Only The number of seconds to wait between reconnection attempts.

A positive integer.