Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to put all output from show_sql in a separate file?

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 separate 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?

like image 655
Blankman Avatar asked Jul 19 '10 20:07

Blankman


1 Answers

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

See also

  • 3.5. Logging
like image 84
Pascal Thivent Avatar answered Oct 22 '22 20:10

Pascal Thivent