问题
I have removed the property hibernate.show_sql
from my EntityManager creation and want to replace it with a logging level. I am using java's logging facility.
As explained in this answer I should set the log level of org.hibernate.SQL.
I have tried it with my logging.properties, but it doesn't work:
handlers=java.util.logging.ConsoleHandler
org.hibernate.level=FINE
org.hibernate.SQL.level=FINEST
org.hibernate.type.level=FINER
I had also tried ALL, but it makes no difference.
What is wrong?
回答1:
After some debugging I ended up with following configuration:
handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=FINE
org.hibernate.level=WARN
org.hibernate.SQL.level=FINE
来源:https://stackoverflow.com/questions/32483899/how-to-enable-hibernates-sql-logging-via-logging-properties