Class AwsLogDriverProps.Builder
java.lang.Object
software.amazon.awscdk.services.ecs.AwsLogDriverProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<AwsLogDriverProps>
- Enclosing interface:
AwsLogDriverProps
@Stability(Stable)
public static final class AwsLogDriverProps.Builder
extends Object
implements software.amazon.jsii.Builder<AwsLogDriverProps>
A builder for
AwsLogDriverProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.datetimeFormat
(String datetimeFormat) Sets the value ofAwsLogDriverProps.getDatetimeFormat()
Sets the value ofAwsLogDriverProps.getLogGroup()
logRetention
(RetentionDays logRetention) Sets the value ofAwsLogDriverProps.getLogRetention()
maxBufferSize
(Size maxBufferSize) Sets the value ofAwsLogDriverProps.getMaxBufferSize()
mode
(AwsLogDriverMode mode) Sets the value ofAwsLogDriverProps.getMode()
multilinePattern
(String multilinePattern) Sets the value ofAwsLogDriverProps.getMultilinePattern()
streamPrefix
(String streamPrefix) Sets the value ofAwsLogDriverProps.getStreamPrefix()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
streamPrefix
Sets the value ofAwsLogDriverProps.getStreamPrefix()
- Parameters:
streamPrefix
- Prefix for the log streams. This parameter is required. 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
- Returns:
this
-
datetimeFormat
Sets the value ofAwsLogDriverProps.getDatetimeFormat()
- Parameters:
datetimeFormat
- 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.- Returns:
this
-
logGroup
Sets the value ofAwsLogDriverProps.getLogGroup()
- Parameters:
logGroup
- The log group to log to.- Returns:
this
-
logRetention
Sets the value ofAwsLogDriverProps.getLogRetention()
- Parameters:
logRetention
- The number of days log events are kept in CloudWatch Logs when the log group is automatically created by this construct.- Returns:
this
-
maxBufferSize
Sets the value ofAwsLogDriverProps.getMaxBufferSize()
- Parameters:
maxBufferSize
- 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.- Returns:
this
-
mode
Sets the value ofAwsLogDriverProps.getMode()
- Parameters:
mode
- The delivery mode of log messages from the container to awslogs.- Returns:
this
-
multilinePattern
Sets the value ofAwsLogDriverProps.getMultilinePattern()
- Parameters:
multilinePattern
- 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.
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<AwsLogDriverProps>
- Returns:
- a new instance of
AwsLogDriverProps
- Throws:
NullPointerException
- if any required attribute was not provided
-