Skip to content

Commit

Permalink
switch log format from text to JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
garysassano committed Mar 16, 2024
1 parent d9beaf1 commit 595cfc9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions libs/awscdk/src/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Function as CdkFunction,
Code,
Runtime,
LogFormat,
} from "aws-cdk-lib/aws-lambda";
import { LogGroup, RetentionDays } from "aws-cdk-lib/aws-logs";
import { Asset } from "aws-cdk-lib/aws-s3-assets";
Expand Down Expand Up @@ -174,6 +175,7 @@ export class Function
memorySize: props.memory ?? 1024,
architecture: Architecture.ARM_64,
logGroup: logs,
logFormat: LogFormat.JSON,
});
}

Expand Down
2 changes: 1 addition & 1 deletion libs/wingsdk/.projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const CDKTF_VERSION = "0.20.3";
const AWS_SDK_VERSION = "3.490.0";

const CDKTF_PROVIDERS = [
"aws@~>5.31.0",
"aws@~>5.41.0",
"random@~>3.5.1",
"azurerm@~>3.54.0",
"google@~>5.10.0",
Expand Down
2 changes: 1 addition & 1 deletion libs/wingsdk/cdktf.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions libs/wingsdk/src/target-tf-aws/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ export class Function extends cloud.Function implements IAwsFunction {
: Duration.fromMinutes(1).seconds,
memorySize: props.memory ?? DEFAULT_MEMORY_SIZE,
architectures: ["arm64"],
loggingConfig: {
logFormat: "JSON",
},
});

if (
Expand Down

0 comments on commit 595cfc9

Please sign in to comment.