Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable logging of DynamoDB queries in the Spring Boot application?

I developed a Spring Boot (2.3.3) application which stores its data in DynamoDB.

I used the following packages to CRUD my data:

  • aws-java-sdk-dynamodb (1.11.891)
  • spring-data-dynamodb (5.1.0)

All works well, but I want to enable logging of requests my app makes to DynamoDB to be able to optimize it (use proper index, etc.).

I tried to configure log4j using this AWS SDK docs. But I still don't see any AWS SDK related lines in my app console output.

Please, help!

like image 380
907th Avatar asked Oct 16 '25 12:10

907th


1 Answers

For logging AWS dynamodb i use log4j and add following property in log4j.xml

<Logger name="org.apache.http.wire" level="trace"/>

This will print all calls which make to dynamodb server.

ref:- https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/logging-slf4j.html

like image 103
Abhinav Sahu Avatar answered Oct 18 '25 05:10

Abhinav Sahu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!