Class: AWSCDK::ECS::AWSLogDriverProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ECS::AWSLogDriverProps
- Defined in:
- ecs/aws_log_driver_props.rb
Overview
Specifies the awslogs log driver configuration options.
Instance Attribute Summary collapse
-
#datetime_format ⇒ String?
readonly
This option defines a multiline start pattern in Python strftime format.
-
#log_group ⇒ AWSCDK::Interfaces::AWSLogs::ILogGroupRef?
readonly
The log group to log to.
-
#log_retention ⇒ AWSCDK::Logs::RetentionDays?
readonly
The number of days log events are kept in CloudWatch Logs when the log group is automatically created by this construct.
-
#max_buffer_size ⇒ AWSCDK::Size?
readonly
When AwsLogDriverMode.NON_BLOCKING is configured, this parameter controls the size of the non-blocking buffer used to temporarily store messages.
-
#mode ⇒ AWSCDK::ECS::AWSLogDriverMode?
readonly
The delivery mode of log messages from the container to awslogs.
-
#multiline_pattern ⇒ String?
readonly
This option defines a multiline start pattern using a regular expression.
-
#stream_prefix ⇒ String
readonly
Prefix for the log streams.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(stream_prefix:, datetime_format: nil, log_group: nil, log_retention: nil, max_buffer_size: nil, mode: nil, multiline_pattern: nil) ⇒ AWSLogDriverProps
constructor
A new instance of AWSLogDriverProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(stream_prefix:, datetime_format: nil, log_group: nil, log_retention: nil, max_buffer_size: nil, mode: nil, multiline_pattern: nil) ⇒ AWSLogDriverProps
Returns a new instance of AWSLogDriverProps.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'ecs/aws_log_driver_props.rb', line 14 def initialize(stream_prefix:, datetime_format: nil, log_group: nil, log_retention: nil, max_buffer_size: nil, mode: nil, multiline_pattern: nil) @stream_prefix = stream_prefix Jsii::Type.check_type(@stream_prefix, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "streamPrefix") @datetime_format = datetime_format Jsii::Type.check_type(@datetime_format, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "datetimeFormat") unless @datetime_format.nil? @log_group = log_group Jsii::Type.check_type(@log_group, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19sb2dzLklMb2dHcm91cFJlZiJ9")), "logGroup") unless @log_group.nil? @log_retention = log_retention Jsii::Type.check_type(@log_retention, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5SZXRlbnRpb25EYXlzIn0=")), "logRetention") unless @log_retention.nil? @max_buffer_size = max_buffer_size Jsii::Type.check_type(@max_buffer_size, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "maxBufferSize") unless @max_buffer_size.nil? @mode = mode Jsii::Type.check_type(@mode, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkF3c0xvZ0RyaXZlck1vZGUifQ==")), "mode") unless @mode.nil? @multiline_pattern = multiline_pattern Jsii::Type.check_type(@multiline_pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "multilinePattern") unless @multiline_pattern.nil? end |
Instance Attribute Details
#datetime_format ⇒ String? (readonly)
Default: - No multiline matching.
This option defines a multiline start pattern in Python strftime format.
A log message consists of a line that matches the pattern and any following lines that don’t match the pattern. Thus the matched line is the delimiter between log messages.
52 53 54 |
# File 'ecs/aws_log_driver_props.rb', line 52 def datetime_format @datetime_format end |
#log_group ⇒ AWSCDK::Interfaces::AWSLogs::ILogGroupRef? (readonly)
Default: - A log group is automatically created.
The log group to log to.
57 58 59 |
# File 'ecs/aws_log_driver_props.rb', line 57 def log_group @log_group end |
#log_retention ⇒ AWSCDK::Logs::RetentionDays? (readonly)
Default: - Logs never expire.
The number of days log events are kept in CloudWatch Logs when the log group is automatically created by this construct.
62 63 64 |
# File 'ecs/aws_log_driver_props.rb', line 62 def log_retention @log_retention end |
#max_buffer_size ⇒ AWSCDK::Size? (readonly)
Default: - 1 megabyte if driver mode is non-blocking, otherwise this property is not set
When AwsLogDriverMode.NON_BLOCKING is configured, this parameter controls the size of the non-blocking buffer used to temporarily store messages. This parameter is not valid with AwsLogDriverMode.BLOCKING.
67 68 69 |
# File 'ecs/aws_log_driver_props.rb', line 67 def max_buffer_size @max_buffer_size end |
#mode ⇒ AWSCDK::ECS::AWSLogDriverMode? (readonly)
Default: - AwsLogDriverMode.BLOCKING
The delivery mode of log messages from the container to awslogs.
72 73 74 |
# File 'ecs/aws_log_driver_props.rb', line 72 def mode @mode end |
#multiline_pattern ⇒ String? (readonly)
Default: - No multiline matching.
This option defines a multiline start pattern using a regular expression.
A log message consists of a line that matches the pattern and any following lines that don’t match the pattern. Thus the matched line is the delimiter between log messages.
This option is ignored if datetimeFormat is also configured.
83 84 85 |
# File 'ecs/aws_log_driver_props.rb', line 83 def multiline_pattern @multiline_pattern end |
#stream_prefix ⇒ String (readonly)
Prefix for the log streams.
The awslogs-stream-prefix option allows you to associate a log stream with the specified prefix, the container name, and the ID of the Amazon ECS task to which the container belongs. If you specify a prefix with this option, then the log stream takes the following format:
prefix-name/container-name/ecs-task-id
43 44 45 |
# File 'ecs/aws_log_driver_props.rb', line 43 def stream_prefix @stream_prefix end |
Class Method Details
.jsii_properties ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 |
# File 'ecs/aws_log_driver_props.rb', line 85 def self.jsii_properties { :stream_prefix => "streamPrefix", :datetime_format => "datetimeFormat", :log_group => "logGroup", :log_retention => "logRetention", :max_buffer_size => "maxBufferSize", :mode => "mode", :multiline_pattern => "multilinePattern", } end |
Instance Method Details
#to_jsii ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'ecs/aws_log_driver_props.rb', line 97 def to_jsii result = {} result.merge!({ "streamPrefix" => @stream_prefix, "datetimeFormat" => @datetime_format, "logGroup" => @log_group, "logRetention" => @log_retention, "maxBufferSize" => @max_buffer_size, "mode" => @mode, "multilinePattern" => @multiline_pattern, }) result.compact end |