Skip to content
v2.275.0

GelfLogDriverProps Struct ​

Specifies the journald log driver configuration options.

Source

Example ​

ts
// 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 ​

addressstringaddressstraddressStringAddressstringAddress*stringrequired#
The address of the GELF server.

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

compressionLeveloptionalnumbercompression_leveloptionalint | floatcompressionLeveloptionalNumberCompressionLeveloptionaldoubleCompressionLeveloptional*float64= 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.

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

Allowed values are gzip, zlib and none.

envoptionalstring[]envoptionaltyping.List[str]envoptionalList<String>Envoptionalstring[]Envoptional*[]*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.

envRegexoptionalstringenv_regexoptionalstrenvRegexoptionalStringEnvRegexoptionalstringEnvRegexoptional*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.

labelsoptionalstring[]labelsoptionaltyping.List[str]labelsoptionalList<String>Labelsoptionalstring[]Labelsoptional*[]*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.

tagoptionalstringtagoptionalstrtagoptionalStringTagoptionalstringTagoptional*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.

tcpMaxReconnectoptionalnumbertcp_max_reconnectoptionalint | floattcpMaxReconnectoptionalNumberTcpMaxReconnectoptionaldoubleTcpMaxReconnectoptional*float64= 3#
TCP Only The maximum number of reconnection attempts when the connection drop.

A positive integer.

tcpReconnectDelayoptionalDurationtcp_reconnect_delayoptionalDurationtcpReconnectDelayoptionalDurationTcpReconnectDelayoptionalDurationTcpReconnectDelayoptionalDuration= 1#
TCP Only The number of seconds to wait between reconnection attempts.

A positive integer.