GelfLogDriverProps
- class aws_cdk.aws_ecs.GelfLogDriverProps(*, env=None, env_regex=None, labels=None, tag=None, address, compression_level=None, compression_type=None, tcp_max_reconnect=None, tcp_reconnect_delay=None)
Bases:
BaseLogDriverProps
Specifies the journald log driver configuration options.
- Parameters:
env (
Optional
[Sequence
[str
]]) – 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. Default: - No envenv_regex (
Optional
[str
]) – 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. Default: - No envRegexlabels (
Optional
[Sequence
[str
]]) – 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. Default: - No labelstag (
Optional
[str
]) – 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. Default: - The first 12 characters of the container IDaddress (
str
) – The address of the GELF server. tcp and udp are the only supported URI specifier and you must specify the port.compression_level (
Union
[int
,float
,None
]) – 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. Default: - 1compression_type (
Optional
[GelfCompressionType
]) – UDP Only The type of compression the GELF driver uses to compress each log message. Allowed values are gzip, zlib and none. Default: - gziptcp_max_reconnect (
Union
[int
,float
,None
]) – TCP Only The maximum number of reconnection attempts when the connection drop. A positive integer. Default: - 3tcp_reconnect_delay (
Optional
[Duration
]) – TCP Only The number of seconds to wait between reconnection attempts. A positive integer. Default: - 1
- ExampleMetadata:
infused
Example:
# Create a Task Definition for the container to start task_definition = ecs.Ec2TaskDefinition(self, "TaskDef") task_definition.add_container("TheContainer", image=ecs.ContainerImage.from_registry("example-image"), memory_limit_mi_b=256, logging=ecs.LogDrivers.gelf(address="my-gelf-address") )
Attributes
- address
The address of the GELF server.
tcp and udp are the only supported URI specifier and you must specify the port.
- compression_level
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.
- Default:
1
- compression_type
UDP Only The type of compression the GELF driver uses to compress each log message.
Allowed values are gzip, zlib and none.
- Default:
gzip
- 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.
- Default:
No env
- env_regex
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.
- Default:
No envRegex
- 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.
- Default:
No labels
- tag
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.
- Default:
The first 12 characters of the container ID
- tcp_max_reconnect
TCP Only The maximum number of reconnection attempts when the connection drop.
A positive integer.
- Default:
3
- tcp_reconnect_delay
TCP Only The number of seconds to wait between reconnection attempts.
A positive integer.
- Default:
1