springboot-How to print JPA and jdbcTemplate SQL logs in SpringBoot apps?
1. The purpose of this post
This demo show how to print SQL logs of your dao when using springboot apps.
2. Environments
- SpringBoot 1.x and 2.x
- Java 1.8+
3. JPA solution
Just add this to your application.properties
Then you would get this:
You can find detail document of this settings in Data Access of SpringBoot Reference.
4. JdbcTemplate solution
Just add this to your application.properties
Then you would get this: