WEB-INF目录下的logback.xml的configuration节点新增:
<!-- 打印SQL debug -->
<logger name="java.sql.Connection">
<level value="debug" />
<appender-ref ref="sqlappender" />
</logger>
<logger name="java.sql.Statement">
<level value="debug" />
<appender-ref ref="sqlappender" />
</logger>
<logger name="java.sql.CallableStatement">
<level value="debug" />
<appender-ref ref="sqlappender" />
</logger>
<logger name="java.sql.PreparedStatement">
<level value="debug" />
<appender-ref ref="sqlappender" />
</logger>