I like to use SLF4J (with the log4j binding) for most of my projects' logging system. I'm rolling up my sleeves with Hibernate for the very first time, and see that one can enable/disable the printing of SQL statements (as executed by Hibernate) by using the following property in your hibernate.cfg.xml file:
<property name="show_sql">true</property>
Is there any way to specify this inside my log4j config XML instead of inside the Hibernate config? I'd like to unify all of my logging settings into one configuration file.
show_sqlis true, then Hibernate logs the SQL statements to STDOUT (I believe - but please correct me if I'm wrong there). So it would be nice to define where STDOUT goes from inside slf4j/log4j, since they are my logging mechanism, andshow_sqlfalls into the domain/realm of logging. Thanks again!myapplog.txt." So I'm wondering here if the solution is to just keepshow_sqlalways turned on, and then let log4j determine what to do with STDOUT? Is that a viable solution?