views:

80

answers:

1

When developing or running a spring mvc app locally that uses hibernate, it would be nice if I could get the output of all sql to a seperate file.

Is this possible?

I know there is a hibernate property show_sql but I believe that will just get jumbled together with all other log4j logging info correct?

+5  A: 

Set the org.hibernate.SQL category to DEBUG and use a specific appender for it.

See also

Pascal Thivent
great, now I need to learn how to use a specific appender. Man java is one config issue to another, will it end!? :)
Blankman
@Blankman: Never :) Luckily, you'll find some samples in http://stackoverflow.com/questions/436276/configuring-hibernate-logging-using-log4j-xml-config-file and http://stackoverflow.com/questions/2332608/log4j-org-hibernate-type-doesnt-work.
Pascal Thivent