Class GelfLogDriverProps
Specifies the journald log driver configuration options.
Inheritance
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.AWS.ECS.dll
Syntax (csharp)
public class GelfLogDriverProps : Object, IGelfLogDriverProps, IBaseLogDriverProps
Syntax (vb)
Public Class GelfLogDriverProps
Inherits Object
Implements IGelfLogDriverProps, IBaseLogDriverProps
Remarks
ExampleMetadata: infused
Examples
// Create a Task Definition for the container to start
var taskDefinition = new Ec2TaskDefinition(this, "TaskDef");
taskDefinition.AddContainer("TheContainer", new ContainerDefinitionOptions {
Image = ContainerImage.FromRegistry("example-image"),
MemoryLimitMiB = 256,
Logging = LogDrivers.Gelf(new GelfLogDriverProps { Address = "my-gelf-address" })
});
Synopsis
Constructors
GelfLogDriverProps() |
Properties
Address | The address of the GELF server. |
CompressionLevel | UDP Only The level of compression when gzip or zlib is the gelf-compression-type. |
CompressionType | UDP Only The type of compression the GELF driver uses to compress each log message. |
Env | The env option takes an array of keys. |
EnvRegex | The env-regex option is similar to and compatible with env. |
Labels | The labels option takes an array of keys. |
Tag | By default, Docker uses the first 12 characters of the container ID to tag log messages. |
TcpMaxReconnect | TCP Only The maximum number of reconnection attempts when the connection drop. |
TcpReconnectDelay | TCP Only The number of seconds to wait between reconnection attempts. |
Constructors
GelfLogDriverProps()
public GelfLogDriverProps()
Properties
Address
The address of the GELF server.
public string Address { get; set; }
Property Value
System.String
Remarks
tcp and udp are the only supported URI specifier and you must specify the port.
CompressionLevel
UDP Only The level of compression when gzip or zlib is the gelf-compression-type.
public Nullable<double> CompressionLevel { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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
CompressionType
UDP Only The type of compression the GELF driver uses to compress each log message.
public Nullable<GelfCompressionType> CompressionType { get; set; }
Property Value
System.Nullable<GelfCompressionType>
Remarks
Allowed values are gzip, zlib and none.
Default: - gzip
Env
The env option takes an array of keys.
public string[] Env { get; set; }
Property Value
System.String[]
Remarks
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
EnvRegex
The env-regex option is similar to and compatible with env.
public string EnvRegex { get; set; }
Property Value
System.String
Remarks
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.
public string[] Labels { get; set; }
Property Value
System.String[]
Remarks
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.
public string Tag { get; set; }
Property Value
System.String
Remarks
Refer to the log tag option documentation for customizing the log tag format.
Default: - The first 12 characters of the container ID
TcpMaxReconnect
TCP Only The maximum number of reconnection attempts when the connection drop.
public Nullable<double> TcpMaxReconnect { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
A positive integer.
Default: - 3
TcpReconnectDelay
TCP Only The number of seconds to wait between reconnection attempts.
public Duration TcpReconnectDelay { get; set; }
Property Value
Remarks
A positive integer.
Default: - 1