Hi all!
I'm using EJB 3.0 with hibernate and I'd like to log all the SQL queries that are performed by Hibernate. I've changed the log4j.xml to get the queries with the following code
<category name="org.hibernate"> <priority value="DEBUG"/> </category> <!-- Log SQL statements--> <category name="org.hibernate.SQL"> <priority value="DEBUG"/> </category> <!-- Log the values assigned to the SQL parameters and results --> <category name="org.hibernate.type"> <priority value="DEBUG"/> </category> <!-- print EJBQL and parameters --> <category name="org.hibernate.impl.SessionImpl"> <priority value="debug"/> </category> <category name="org.hibernate.engine.QueryParameters"> <priority value="debug" /> </category>
2006-08-08 11:26:29,203 DEBUG [org.hibernate.SQL] insert into TRABAJOLABORATORIO (TECNICOLABORATORIO, FECHAESTADO, DESCRIPCION, FECHAPREVENTPIEZA, EST ADOPIEZA, IDPRODUCTO, IDEVOLUCIONDISENYOACEPTADA, IDPRIMERAEVOLUCION, TIPOPIEZA, IDLINEASOLICITUDSERIE, IDTRABAJO) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)