This content has been marked as final.
Show 4 replies
-
1. Re: How to enable log level for EJB3 QL?
alrubinger Aug 29, 2006 2:42 PM (in response to hotat27)EJB3 Entities in JBoss use Hibernate under the hood. So in persistence.xml, I pass in the property:
<property name="hibernate.show_sql" value="true" />
I'm pretty sure this instructs Hibernate to write to System.out. If anyone knows how to get this sent to Commong Logging or Log4J appenders, I'd love to know.
I also like to see the output from the Schema Export, so set the following in my $JBOSS_HOME/server//[servername]/conf/log4j.xml:<!-- Show SQL Logs for Hibernate Schema Export --> <category name="org.hibernate.tool.hbm2ddl.SchemaExport"> <priority value="DEBUG" /> </category>
S,
ALR -
2. Re: How to enable log level for EJB3 QL?
muhviehstarr Aug 30, 2006 3:41 AM (in response to hotat27)you just need to add this to your log4j.xml:
<category name="org.hibernate.SQL"> <priority value="DEBUG"/> <appender-ref ref="YOURAPPENDER"/> </category>
-
3. Re: How to enable log level for EJB3 QL?
alrubinger Aug 30, 2006 10:56 AM (in response to hotat27)Beautiful; thank you.
S,
ALR"muhviehstarr" wrote:
you just need to add this to your log4j.xml:<category name="org.hibernate.SQL"> <priority value="DEBUG"/> <appender-ref ref="YOURAPPENDER"/> </category>
-
4. Re: How to enable log level for EJB3 QL?
alrubinger Aug 30, 2006 1:23 PM (in response to hotat27)Good logging reference at the bottom of:
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossHibernate3.
S,
ALR