amazon s3 – The aws sdk java 2.x is printing token and file contents when log level is set to DEBUG
We have a quarkus application that exposes api endpoint to receive request containing a file and uploads the file to S3 bucket.
When application root log level is set to DEBuG and when the request is sent , the application logs is printing information like the security token and the credentials and the file content and file name .
How can we disable this ? we do not want the application logs to have these information even though the log level is set to DEBUG.
Below is the example log.
2024-09-23 06:38:15 DEBUG [io.ne.ha.lo.LoggingHandler] (aws-java-sdk-NettyEventLoop-0-1) [id: 0x775d66e9] REGISTERED
2024-09-23 06:38:15 DEBUG [io.ne.ha.lo.LoggingHandler] (aws-java-sdk-NettyEventLoop-0-1) [id: 0x775d66e9] CONNECT: test-bucket.s3.ap-south-1.amazonaws.com/52.219.64.101:443
2024-09-23 06:38:15 DEBUG [io.ne.ha.lo.LoggingHandler] (aws-java-sdk-NettyEventLoop-0-1) [id: 0x775d66e9, L:/192.168.3.254:50328 – R:test-bucket.s3.ap-south-1.amazonaws.com/52.219.64.101:443] ACTIVE
2024-09-23 06:38:15 DEBUG [io.ne.ha.lo.LoggingHandler] (aws-java-sdk-NettyEventLoop-0-1) [id: 0x775d66e9, L:/192.168.3.254:50328 – R:test-bucket.s3.ap-south-1.amazonaws.com/52.219.64.101:443] WRITE: software.amazon.awssdk.http.nio.netty.internal.NettyRequestExecutor$StreamedRequest(DefaultHttpRequest(decodeResult: success, version: HTTP/1.1)
PUT /0148ffa2-52c0-11ec-ae45-02b72c6380ad/1727073495061-testfile.txt HTTP/1.1
Host: test-bucket.s3.ap-south-1.amazonaws.com
amz-sdk-invocation-id: d455aa4e-4a17-0a54-8340-12aeaa515ab2
amz-sdk-request: attempt=1; max=4
Authorization: AWS4-HMAC-SHA256 Credential=ASIA3NWURXFPB7MDWNVL/20240923/ap-south-1/s3/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-length;content-type;host;x-amz-content-sha256;x-amz-date;x-amz-meta-contenttype;x-amz-meta-uploadedfilename;x-amz-security-token, Signature=50f108e5685ad5ea34e668e386d34a7d503e99e8b2339eb4eba8b6eb3022296
Content-Length: 58
Read more here: Source link