How to log SQL queries, their parameters and results with Log4jdbc in Spring Boot projects?

Viewed 5137

To view SQL queries sent to DB we usually use showSql parameter:

spring.jpa.showSql=true

It allows us to see the statement body but not its parameters:

insert into master (id, version, name) values (null, ?, ?)

And especially we don't see a result of the query.

Is there a way to see SQL statement, its parameters and result in the application log?

1 Answers
Related