OK, I've found the answer:

First of all, since my question was not clear enough, let me explain:
JBoss logs SQL statements in the server.log (which is located in the \log 
directory of the server's directory (e.g., %JBOSS_HOME%\server\default\log); 
what I wanted was to make a separate log file for the SQL statements.

So, how to do it?

A modification is needed in the log4j.xml file (which is located in the \conf 
directory of the server's directory).
There should be added an appender, and a category elements.

Let's say that the I want to name of the new log file "SQLs.log", so, the 
modification that should be made in the log4j.xml file are as follows:

   <!-- ================================================= -->
  |    <!-- Append SQL generated by JBoss CMP to the log file -->
  |    <!-- ================================================= -->
  |    <appender name="CMP" 
class="org.jboss.logging.appender.RollingFileAppender">
  |      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
  |      <param name="File" value="${jboss.server.home.dir}/log/SQLs.log"/>
  |      <param name="Append" value="false"/>
  |      <param name="MaxFileSize" value="500KB"/>
  |      <param name="MaxBackupIndex" value="1"/>
  | 
  |      <layout class="org.apache.log4j.PatternLayout">
  |        <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
  |      </layout>          
  |    </appender>
  | 
  | 
  | 
  |    <!-- Limit the org.jboss.ejb.plugins.cmp category to DEBUG -->
  |    <category name="org.jboss.ejb.plugins.cmp">
  |      <priority value="DEBUG" />
  |      <appender-ref ref="CMP"/>
  |    </category>

And that does the trick!!!

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3903663#3903663

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3903663


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to