druid 數據源 sql控制臺輸出
阿新 • • 發佈:2018-04-12
resultset lis spring exe ogg nbsp pool tab IT
開發環境使用
spring
<bean id="log-filter" class="com.alibaba.druid.filter.logging.Slf4jLogFilter"> <property name="connectionLogEnabled" value="false"/> <property name="statementLogEnabled" value="false"/> <property name="resultSetLogEnabled" value="true"/><property name="statementExecutableSqlLogEnable" value="true"/> </bean>
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close" abstract="true"> <property name="proxyFilters"> <list><ref bean="log-filter"/> </list> </property> </bean>
log4j.xml
<logger name="druid.sql.Statement" additivity="false"> <level value="DEBUG"/> <appender-ref ref="consoleAppender"/> </logger>
druid 數據源 sql控制臺輸出