log4j.xml
log4j:
打印sql配置
<?xmlversion="1.0"encoding="GBK"?>
<!DOCTYPElog4j:configurationSYSTEM"http://toolkit.alibaba-inc.com/dtd/log4j/log4j.dtd">
<log4j:configurationxmlns:log4j="http://jakarta.apache.org/log4j/">
<!--=====================================================================-->
<!--appender配置-->
<!--=====================================================================-->
<appendername="whcConsole"class="org.apache.log4j.ConsoleAppender">
<paramname="append"value="true"/>
<paramname="encoding"value="GBK"/>
<layoutclass="org.apache.log4j.PatternLayout">
<paramname="ConversionPattern"value="%d[]%-5p%c{2}-%m%n"/>
</layout>
</appender>
<appendername="whc"class="org.apache.log4j.DailyRollingFileAppender">
<paramname="file"value="${whc.loggingRoot}/whc.log"/>
<paramname="append"value="true"/>
<paramname="encoding"value="GBK"/>
<layoutclass="org.apache.log4j.PatternLayout">
<paramname="ConversionPattern"value="%d[]%-5p%c{2}-%m%n"/>
</layout>
</appender>
<loggername="com.ibatis.common.jdbc.SimpleDataSource">
<levelvalue="DEBUG"/>
</logger>
<loggername="com.ibatis.common.jdbc.ScriptRunner">
<levelvalue="DEBUG"/>
</logger>
<loggername="com.ibatis.sqlmap.client.SqlMapClient">
<levelvalue="DEBUG"/>
</logger>
<loggername="java.sql.Connection"additivity="true">
<levelvalue="DEBUG"/>
</logger>
<loggername="java.sql.Statement"additivity="true">
<levelvalue="DEBUG"/>
</logger>
<loggername="java.sql.PreparedStatement"additivity="true">
<levelvalue="DEBUG"/>
</logger>
<!--=====================================================================-->
<!--其余内容打到rootlogger-->
<!--=====================================================================-->
<root>
<levelvalue="debug"/>
<appender-refref="whc"/>
<appender-refref="whcConsole"/>
</root>
</log4j:configuration>