I've been trying to get this simple use case to work but can't: Define a default Threshold of INFO on a FILE Appender, but define a category with DEBUG level. This is a jboss 4.2.1.GA log4j.xml file that I am using where I just want to log java.sql calls.
<appender name="SQL_FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${jboss.server.log.dir}/sql.log"/>
<param name="Append" value="false"/>
<param name="Threshold" value="INFO"/>
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c] %C %m%n"/>
</layout>
</appender>
<category name="java.sql">
<priority value="DEBUG"/>
<appender-ref ref="SQL_FILE"/>
</category>
<root>
<appender-ref ref="SQL_FILE"/>
</root>
Instead of logging just java.sql it logs INFO and above and does not include any java.sql information. If there is no easy solution then I am left with setting the appender Threshold to DEBUG and turning off all logging for the multiple categories that get included, which seems a waste of time.
I tried the following but couldn't get it to work: http://stackoverflow.com/questions/2050615/configuring-multiple-log-files-in-log4j-while-using-categories.