怎么样配置druid将sql语句及参数记录到日志文件中去
1个回答
展开全部
<!-- 每隔5分钟将监控日志输出到日志文件中,单位是毫秒。 --> <property name="timeBetweenLogStatsMillis" value="300000" /> <!-- 监控数据库 --> <property name="proxyFilters"> <list> <ref bean="stat-filter" /> <ref bean="wall-filter" /> <ref bean="log-filter" /> </list> </property> <bean id="stat-filter" class="com.alibaba.druid.filter.stat.StatFilter"> <property name="slowSqlMillis" value="3000" /> <property name="logSlowSql" value="true" /> <property name="mergeSql" value="true" /> </bean> <bean id="log-filter" class="com.alibaba.druid.filter.logging.Log4jFilter"> <!-- <property name="resultSetLogEnabled" value="false" /> --> <!-- <property name="statementExecutableSqlLogEnable" value="true" /> --> </bean> <bean id="wall-filter" class="com.alibaba.druid.wall.WallFilter"> <property name="dbType" value="oracle" /> <property name="config" ref="wall-filter-config" /> </bean> <bean id="wall-filter-config" class="com.alibaba.druid.wall.WallConfig" init-method="init"> <property name="dir" value="META-INF/druid/wall/oracle" /> </bean>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询