Describe the bug
After switching from 4.1.1 to 4.1.2 AWSLambdaUtils divides input JSON into multiple log entries preventing AWS Cloudwatch from formatting it properly and causing a huge amount of logs.
In 4.1.1 it logged the entire input in a single log entry and AWS CloudWatch formatted and colored it, while now we get one JSON line per log entry.
|
logger.info("Received: " + mask(new String(payload, StandardCharsets.UTF_8))); |
It's probably caused by SerializationFeature.INDENT_OUTPUT in the new JsonMasker class.
|
this.mapper = new JacksonMapper(new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT)); |
Can you remove this feature / give an option to disable it or/and at least skip processing by JsonMasker when keysToMask is empty?
Sample
Any AWS Lambda application that accepts JSON input
Describe the bug
After switching from 4.1.1 to 4.1.2 AWSLambdaUtils divides input JSON into multiple log entries preventing AWS Cloudwatch from formatting it properly and causing a huge amount of logs.
In 4.1.1 it logged the entire input in a single log entry and AWS CloudWatch formatted and colored it, while now we get one JSON line per log entry.
spring-cloud-function/spring-cloud-function-adapters/spring-cloud-function-adapter-aws/src/main/java/org/springframework/cloud/function/adapter/aws/AWSLambdaUtils.java
Line 116 in f0ae10f
It's probably caused by SerializationFeature.INDENT_OUTPUT in the new JsonMasker class.
spring-cloud-function/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/utils/JsonMasker.java
Line 56 in f0ae10f
Can you remove this feature / give an option to disable it or/and at least skip processing by JsonMasker when keysToMask is empty?
Sample
Any AWS Lambda application that accepts JSON input