-
1. Re: hibernate + log4j.xml = can not get it work
peterj Mar 25, 2009 5:26 PM (in response to dmitri.ilyin)I think what are looking for are the SQL statements used by Hibernate. To get those, add the following entry to your persistence.xml file:
<persistence ...> <persistence-unit ...> ... <properties> <property name="hibernate.show_sql" value="true"/>
-
2. Re: hibernate + log4j.xml = can not get it work
dmitri.ilyin Mar 26, 2009 4:45 AM (in response to dmitri.ilyin)yes,
i have switched it on too. I can see statements, but i also want to see the parameter values and this, as i know, can be done by setting loging properly.
Also i want to write hibernate output log to the specified file. -
3. Re: hibernate + log4j.xml = can not get it work
dmitri.ilyin Mar 26, 2009 11:59 AM (in response to dmitri.ilyin)i have found a problem.
hibernate entity manager 3.4.0 use slf4j as logger (that was new for me).
My project is maven driven, so i have only a hibernate-entitymanager dependency.
maven returns a slf4j-api.jar but not a log4j adapter for slf. It must be done explicitly with dependency slf4j-log4j12.
Also it is important to get the right version. Hibernate use slf4j 1.4.2 so the log4j adapter must also be in this vesion.
So, now i have slf4j-api and log4j adapter in the classpath and my log4j configuration will be used correctly. -
4. Re: hibernate + log4j.xml = can not get it work
peterj Mar 26, 2009 12:23 PM (in response to dmitri.ilyin)I dug through the Hibernate source code and did not see any place where the parameter values are printed, but then I could have missed it. Perhaps you can ask on the hibernate forum if there is any way to do this.
-
5. Re: hibernate + log4j.xml = can not get it work
dmitri.ilyin Mar 26, 2009 12:26 PM (in response to dmitri.ilyin)Now the parameters all will be printed.
The only thing to do is to configure the logger.
Logger for org.hibernate.type must be configured with trace/debug.