Skip to content

Commit 2438fb9

Browse files
Jeel-mehtaJeel Mehta
andauthored
[Java] Adding a custom log (#411)
*Issue description:* We need a reliable way to validate SigV4 logs across different language implementations (Python, JavaScript, .NET, Java) for our sample applications. The current logging doesn't provide a consistent, easily identifiable log entry for this purpose. This PR adds a standardized SigV4 logging mechanism to the Java sample application, similar to what was implemented for Python in [[PR #406]](#406). *Description of changes:* Added a custom WARNING log in the aws_sdk_call function of the Python sample application. This custom log will be present in the log-group and can be used to filter logs from those created while running the sample application. This change provides a consistent log entry that can be replicated across other language implementations for uniform SigV4 log validation. *Rollback procedure:* 1. Remove the line `logger.warn("This is a custom log for validation testing");` from the aws_sdk_call function in views.py. 2. Commit and push the change. 3. Redeploy the application. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Co-authored-by: Jeel Mehta <[email protected]>
1 parent 6970b89 commit 2438fb9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sample-apps/java/springboot-main-service/src/main/java/com/amazon/sampleapp/FrontendServiceController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ public String awssdkCall(@RequestParam(name = "testingId", required = false) Str
9494
if (testingId != null) {
9595
bucketName += "-" + testingId;
9696
}
97+
logger.warn("This is a custom log for validation testing");
9798
GetBucketLocationRequest bucketLocationRequest =
9899
GetBucketLocationRequest.builder().bucket(bucketName).build();
99100
try {

0 commit comments

Comments
 (0)