Interface AwsLogDriverProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
AwsLogDriverProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-24T21:00:29.106Z") @Stability(Stable) public interface AwsLogDriverProps extends software.amazon.jsii.JsiiSerializable
Specifies the awslogs log driver configuration options.

Example:

 // Create a Task Definition for the Windows container to start
 FargateTaskDefinition taskDefinition = FargateTaskDefinition.Builder.create(this, "TaskDef")
         .runtimePlatform(RuntimePlatform.builder()
                 .operatingSystemFamily(OperatingSystemFamily.WINDOWS_SERVER_2019_CORE)
                 .cpuArchitecture(CpuArchitecture.X86_64)
                 .build())
         .cpu(1024)
         .memoryLimitMiB(2048)
         .build();
 taskDefinition.addContainer("windowsservercore", ContainerDefinitionOptions.builder()
         .logging(LogDriver.awsLogs(AwsLogDriverProps.builder().streamPrefix("win-iis-on-fargate").build()))
         .portMappings(List.of(PortMapping.builder().containerPort(80).build()))
         .image(ContainerImage.fromRegistry("mcr.microsoft.com/windows/servercore/iis:windowsservercore-ltsc2019"))
         .build());
 
  • Method Details

    • getStreamPrefix

      @Stability(Stable) @NotNull String getStreamPrefix()
      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
       
    • getDatetimeFormat

      @Stability(Stable) @Nullable default String getDatetimeFormat()
      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.

    • getLogGroup

      @Stability(Stable) @Nullable default ILogGroup getLogGroup()
      The log group to log to.

      Default: - A log group is automatically created.

    • getLogRetention

      @Stability(Stable) @Nullable default RetentionDays getLogRetention()
      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.

    • getMaxBufferSize

      @Stability(Stable) @Nullable default Size getMaxBufferSize()
      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

    • getMode

      @Stability(Stable) @Nullable default AwsLogDriverMode getMode()
      The delivery mode of log messages from the container to awslogs.

      Default: - AwsLogDriverMode.BLOCKING

    • getMultilinePattern

      @Stability(Stable) @Nullable default String getMultilinePattern()
      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.

    • builder

      @Stability(Stable) static AwsLogDriverProps.Builder builder()
      Returns:
      a AwsLogDriverProps.Builder of AwsLogDriverProps