Skip to main content


Showing posts from October, 2006

[JBoss] Logging JBoss CMP SQL with log4j

In many occasions developers tend to get errors when calling the CMP finders. The best method to fix such issues is to view the generated SQL queries, as it's easy to understand the error in terms of general SQL rather than looking at the EJB-QLs.
Log SQLs into a file With the help of log4j, CMP generated SQLs can be logged into a file as follows.
Goto the conf folder inside your server instance. Open the log4j.xml file and add the following two entries to it.   <appender name="CMP" class="org.jboss.logging.appender.RollingFileAppender"> <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/> <param name="File" value="/log/cmpSQL.log"/> <param name="Append" value="false"/> <param name="MaxFileSize" value="800KB"/> <param name="MaxBackupIndex" value="1"/> <layout class="org.apache.log4j.xml.XML…
Creative Commons License Digizol by Kamal Mettananda is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License .
URL of this page must be supplied in attribution
© 2004-2017