Class: AWSCDK::ECS::GelfLogDriverProps

Inherits:
BaseLogDriverProps
  • Object
show all
Defined in:
ecs/gelf_log_driver_props.rb

Overview

Specifies the journald log driver configuration options.

Source

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env: nil, env_regex: nil, labels: nil, tag: nil, address:, compression_level: nil, compression_type: nil, tcp_max_reconnect: nil, tcp_reconnect_delay: nil) ⇒ GelfLogDriverProps

Returns a new instance of GelfLogDriverProps.

Parameters:

  • env (Array<String>, nil) (defaults to: nil)

    The env option takes an array of keys.

  • env_regex (String, nil) (defaults to: nil)

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

  • labels (Array<String>, nil) (defaults to: nil)

    The labels option takes an array of keys.

  • tag (String, nil) (defaults to: nil)

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

  • address (String)

    The address of the GELF server.

  • compression_level (Numeric, nil) (defaults to: nil)

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

  • compression_type (AWSCDK::ECS::GelfCompressionType, nil) (defaults to: nil)

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

  • tcp_max_reconnect (Numeric, nil) (defaults to: nil)

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

  • tcp_reconnect_delay (AWSCDK::Duration, nil) (defaults to: nil)

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



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'ecs/gelf_log_driver_props.rb', line 18

def initialize(env: nil, env_regex: nil, labels: nil, tag: nil, address:, compression_level: nil, compression_type: nil, tcp_max_reconnect: nil, tcp_reconnect_delay: nil)
  @env = env
  Jsii::Type.check_type(@env, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "env") unless @env.nil?
  @env_regex = env_regex
  Jsii::Type.check_type(@env_regex, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "envRegex") unless @env_regex.nil?
  @labels = labels
  Jsii::Type.check_type(@labels, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "labels") unless @labels.nil?
  @tag = tag
  Jsii::Type.check_type(@tag, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tag") unless @tag.nil?
  @address = address
  Jsii::Type.check_type(@address, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "address")
  @compression_level = compression_level
  Jsii::Type.check_type(@compression_level, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "compressionLevel") unless @compression_level.nil?
  @compression_type = compression_type
  Jsii::Type.check_type(@compression_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkdlbGZDb21wcmVzc2lvblR5cGUifQ==")), "compressionType") unless @compression_type.nil?
  @tcp_max_reconnect = tcp_max_reconnect
  Jsii::Type.check_type(@tcp_max_reconnect, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "tcpMaxReconnect") unless @tcp_max_reconnect.nil?
  @tcp_reconnect_delay = tcp_reconnect_delay
  Jsii::Type.check_type(@tcp_reconnect_delay, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "tcpReconnectDelay") unless @tcp_reconnect_delay.nil?
end

Instance Attribute Details

#addressString (readonly)

The address of the GELF server.

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

Returns:

  • (String)


80
81
82
# File 'ecs/gelf_log_driver_props.rb', line 80

def address
  @address
end

#compression_levelNumeric? (readonly)

Note:

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.

Returns:

  • (Numeric, nil)


88
89
90
# File 'ecs/gelf_log_driver_props.rb', line 88

def compression_level
  @compression_level
end

#compression_typeAWSCDK::ECS::GelfCompressionType? (readonly)

Note:

Default: - gzip

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

Allowed values are gzip, zlib and none.



95
96
97
# File 'ecs/gelf_log_driver_props.rb', line 95

def compression_type
  @compression_type
end

#envArray<String>? (readonly)

Note:

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.

Returns:

  • (Array<String>, nil)


47
48
49
# File 'ecs/gelf_log_driver_props.rb', line 47

def env
  @env
end

#env_regexString? (readonly)

Note:

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.

Returns:

  • (String, nil)


56
57
58
# File 'ecs/gelf_log_driver_props.rb', line 56

def env_regex
  @env_regex
end

#labelsArray<String>? (readonly)

Note:

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.

Returns:

  • (Array<String>, nil)


65
66
67
# File 'ecs/gelf_log_driver_props.rb', line 65

def labels
  @labels
end

#tagString? (readonly)

Note:

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.

Returns:

  • (String, nil)


73
74
75
# File 'ecs/gelf_log_driver_props.rb', line 73

def tag
  @tag
end

#tcp_max_reconnectNumeric? (readonly)

Note:

Default: - 3

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

A positive integer.

Returns:

  • (Numeric, nil)


102
103
104
# File 'ecs/gelf_log_driver_props.rb', line 102

def tcp_max_reconnect
  @tcp_max_reconnect
end

#tcp_reconnect_delayAWSCDK::Duration? (readonly)

Note:

Default: - 1

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

A positive integer.

Returns:



109
110
111
# File 'ecs/gelf_log_driver_props.rb', line 109

def tcp_reconnect_delay
  @tcp_reconnect_delay
end

Class Method Details

.jsii_propertiesObject



111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'ecs/gelf_log_driver_props.rb', line 111

def self.jsii_properties
  {
    :env => "env",
    :env_regex => "envRegex",
    :labels => "labels",
    :tag => "tag",
    :address => "address",
    :compression_level => "compressionLevel",
    :compression_type => "compressionType",
    :tcp_max_reconnect => "tcpMaxReconnect",
    :tcp_reconnect_delay => "tcpReconnectDelay",
  }
end

Instance Method Details

#to_jsiiObject



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'ecs/gelf_log_driver_props.rb', line 125

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "env" => @env,
    "envRegex" => @env_regex,
    "labels" => @labels,
    "tag" => @tag,
    "address" => @address,
    "compressionLevel" => @compression_level,
    "compressionType" => @compression_type,
    "tcpMaxReconnect" => @tcp_max_reconnect,
    "tcpReconnectDelay" => @tcp_reconnect_delay,
  })
  result.compact
end