Skip to content

Commit

Permalink
Add multilinePattern to log driver
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Kurait <akurait@amazon.com>
  • Loading branch information
AndreKurait committed Apr 23, 2024
1 parent 1947e64 commit 6b93c75
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
ServiceConnectService,
Ulimit,
OperatingSystemFamily,
Volume
Volume,
AwsLogDriverMode
} from "aws-cdk-lib/aws-ecs";
import {DockerImageAsset} from "aws-cdk-lib/aws-ecr-assets";
import {RemovalPolicy, Stack} from "aws-cdk-lib";
Expand Down Expand Up @@ -130,7 +131,13 @@ export class MigrationServiceCore extends Stack {
portMappings: props.portMappings,
logging: LogDrivers.awsLogs({
streamPrefix: `${props.serviceName}-logs`,
logGroup: serviceLogGroup
logGroup: serviceLogGroup,
// E.g. "[INFO ] 2024-12-31 23:59:59,99999999"
// and "[ERROR] 2024-12-31 23:59:59,999"
// and "2024-12-31 23:59:59"
multilinePattern: "^(\\[[A-Z ]{1,5}\\] )?\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}(,\\d{2,8})?",
// Log appenders are non-blocking so defer async behavior to them
mode: AwsLogDriverMode.BLOCKING,
}),
ulimits: props.ulimits
});
Expand Down Expand Up @@ -169,7 +176,9 @@ export class MigrationServiceCore extends Stack {
logGroup: serviceLogGroup
})
},
cloudMapOptions: cloudMapOptions
cloudMapOptions: cloudMapOptions,
minHealthyPercent: 0,
maxHealthyPercent: 200
});

if (props.serviceDiscoveryEnabled) {
Expand Down

0 comments on commit 6b93c75

Please sign in to comment.