Class: AWSCDK::ECS::JsonFileLogDriverProps
- Inherits:
-
BaseLogDriverProps
- Object
- BaseLogDriverProps
- AWSCDK::ECS::JsonFileLogDriverProps
- Defined in:
- ecs/json_file_log_driver_props.rb
Overview
Specifies the json-file log driver configuration options.
Instance Attribute Summary collapse
-
#compress ⇒ Boolean?
readonly
Toggles compression for rotated logs.
-
#env ⇒ Array<String>?
readonly
The env option takes an array of keys.
-
#env_regex ⇒ String?
readonly
The env-regex option is similar to and compatible with env.
-
#labels ⇒ Array<String>?
readonly
The labels option takes an array of keys.
-
#max_file ⇒ Numeric?
readonly
The maximum number of log files that can be present.
-
#max_size ⇒ String?
readonly
The maximum size of the log before it is rolled.
-
#tag ⇒ String?
readonly
By default, Docker uses the first 12 characters of the container ID to tag log messages.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(env: nil, env_regex: nil, labels: nil, tag: nil, compress: nil, max_file: nil, max_size: nil) ⇒ JsonFileLogDriverProps
constructor
A new instance of JsonFileLogDriverProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(env: nil, env_regex: nil, labels: nil, tag: nil, compress: nil, max_file: nil, max_size: nil) ⇒ JsonFileLogDriverProps
Returns a new instance of JsonFileLogDriverProps.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'ecs/json_file_log_driver_props.rb', line 16 def initialize(env: nil, env_regex: nil, labels: nil, tag: nil, compress: nil, max_file: nil, max_size: 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? @compress = compress Jsii::Type.check_type(@compress, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "compress") unless @compress.nil? @max_file = max_file Jsii::Type.check_type(@max_file, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxFile") unless @max_file.nil? @max_size = max_size Jsii::Type.check_type(@max_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "maxSize") unless @max_size.nil? end |
Instance Attribute Details
#compress ⇒ Boolean? (readonly)
Default: - false
Toggles compression for rotated logs.
72 73 74 |
# File 'ecs/json_file_log_driver_props.rb', line 72 def compress @compress end |
#env ⇒ Array<String>? (readonly)
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.
41 42 43 |
# File 'ecs/json_file_log_driver_props.rb', line 41 def env @env end |
#env_regex ⇒ String? (readonly)
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.
50 51 52 |
# File 'ecs/json_file_log_driver_props.rb', line 50 def env_regex @env_regex end |
#labels ⇒ Array<String>? (readonly)
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.
59 60 61 |
# File 'ecs/json_file_log_driver_props.rb', line 59 def labels @labels end |
#max_file ⇒ Numeric? (readonly)
Default: - 1
The maximum number of log files that can be present.
If rolling the logs creates excess files, the oldest file is removed. Only effective when max-size is also set. A positive integer.
81 82 83 |
# File 'ecs/json_file_log_driver_props.rb', line 81 def max_file @max_file end |
#max_size ⇒ String? (readonly)
Default: - -1 (unlimited)
The maximum size of the log before it is rolled.
A positive integer plus a modifier representing the unit of measure (k, m, or g).
89 90 91 |
# File 'ecs/json_file_log_driver_props.rb', line 89 def max_size @max_size end |
#tag ⇒ String? (readonly)
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.
67 68 69 |
# File 'ecs/json_file_log_driver_props.rb', line 67 def tag @tag end |
Class Method Details
.jsii_properties ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 |
# File 'ecs/json_file_log_driver_props.rb', line 91 def self.jsii_properties { :env => "env", :env_regex => "envRegex", :labels => "labels", :tag => "tag", :compress => "compress", :max_file => "maxFile", :max_size => "maxSize", } end |
Instance Method Details
#to_jsii ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'ecs/json_file_log_driver_props.rb', line 103 def to_jsii result = {} result.merge!(super) result.merge!({ "env" => @env, "envRegex" => @env_regex, "labels" => @labels, "tag" => @tag, "compress" => @compress, "maxFile" => @max_file, "maxSize" => @max_size, }) result.compact end |