Class AwsLogDriver.Builder

java.lang.Object
software.amazon.awscdk.services.ecs.AwsLogDriver.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<AwsLogDriver>
Enclosing class:
AwsLogDriver

@Stability(Stable) public static final class AwsLogDriver.Builder extends Object implements software.amazon.jsii.Builder<AwsLogDriver>
A fluent builder for AwsLogDriver.
  • Method Details

    • create

      @Stability(Stable) public static AwsLogDriver.Builder create()
      Returns:
      a new instance of AwsLogDriver.Builder.
    • streamPrefix

      @Stability(Stable) public AwsLogDriver.Builder streamPrefix(String streamPrefix)
      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
       

      Parameters:
      streamPrefix - Prefix for the log streams. This parameter is required.
      Returns:
      this
    • datetimeFormat

      @Stability(Stable) public AwsLogDriver.Builder datetimeFormat(String 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.

      Default: - No multiline matching.

      Parameters:
      datetimeFormat - This option defines a multiline start pattern in Python strftime format. This parameter is required.
      Returns:
      this
    • logGroup

      @Stability(Stable) public AwsLogDriver.Builder logGroup(ILogGroup logGroup)
      The log group to log to.

      Default: - A log group is automatically created.

      Parameters:
      logGroup - The log group to log to. This parameter is required.
      Returns:
      this
    • logRetention

      @Stability(Stable) public AwsLogDriver.Builder logRetention(RetentionDays logRetention)
      The number of days log events are kept in CloudWatch Logs when the log group is automatically created by this construct.

      Default: - Logs never expire.

      Parameters:
      logRetention - The number of days log events are kept in CloudWatch Logs when the log group is automatically created by this construct. This parameter is required.
      Returns:
      this
    • maxBufferSize

      @Stability(Stable) public AwsLogDriver.Builder maxBufferSize(Size 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.

      Default: - 1 megabyte if driver mode is non-blocking, otherwise this property is not set

      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. This parameter is required.
      Returns:
      this
    • mode

      @Stability(Stable) public AwsLogDriver.Builder mode(AwsLogDriverMode mode)
      The delivery mode of log messages from the container to awslogs.

      Default: - AwsLogDriverMode.BLOCKING

      Parameters:
      mode - The delivery mode of log messages from the container to awslogs. This parameter is required.
      Returns:
      this
    • multilinePattern

      @Stability(Stable) public AwsLogDriver.Builder multilinePattern(String 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.

      Default: - No multiline matching.

      Parameters:
      multilinePattern - This option defines a multiline start pattern using a regular expression. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public AwsLogDriver build()
      Specified by:
      build in interface software.amazon.jsii.Builder<AwsLogDriver>
      Returns:
      a newly built instance of AwsLogDriver.