But nothing is being logged. When I leave the entries in application.properties out the sql query is logged. It looks like there is a conflict between setting show_sql=true in jpaproperties and
spring.jpa.show-sql=true in application.properties . I tried setting show_sql to true, false and leaving it out completely, but query is not logged.
I just tried with this option too with same result.
It looks like every setting related to queries is ignored.
The setting to log in a file is though executed - the file gets created:
Additionally I have set again show_sql to false and removed format_sql in jpaproperties as indicated in the mentioned article.
In this case the query is not logged at all...
I also removed show_sql from jpaproperties, so that only the settings in application.properties remained - in this case an unformatted query is printed, but with no parameter values. (As it is not printed to springboot.log I assume show_sql defaults to true.)
So, is there a way to make the application take these settings in application.properties into consideration?
LE: I have managed to get formatted query and parameters to the console using log4j.xml Thank you for the hint! With file appender the query is logged to console although it should be logged to a file. The file appender is though respected for the parameters. It looks as like the show_sql=true in jpaproperties has priority and loggs by default to console.
With log4j.properties it behaves similar to Springs's application properties - it simply seems to be ignored and query and parameters are not printed.
Still I would like to use the application.properties of Spring.
Opposed to the previous link, this one says show_sql has to be true when using the org.hibernate.SQL logger in xml or properties file.
yes , we do , like in the above link on stackoverflow.
There is no application class annotated with SpringBootApplication , there is a class annotated with Webservice which is basically where it starts.