druid连接池监控在spring中的配置(注)
2017-08-29 11:54
459 查看
第一步在druid连接池dataSource配置中添加(如已存在就不动):
<!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 --> <property name="filters" value="stat" />第二步在web.xml中添加如下代码:
<servlet> <servlet-name>DruidStatView</servlet-name> <servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>DruidStatView</servlet-name> <url-pattern>/druid/*</url-pattern> </servlet-mapping> <filter> <filter-name>DruidWebStatFilter</filter-name> <filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class> <init-param> <param-name>exclusions</param-name> <param-value>*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*</param-value> </init-param> </filter> <filter-mapping> <filter-name>DruidWebStatFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>第三步重启项目,访问http://ip地址:端口号/项目名/druid/index.html,ok!
相关文章推荐
- Druid连接池及监控在spring中的配置
- mybatis使用spring-druid数据源连接池配置log4j打印sql语句以及开启监控平台
- 【项目实践】Druid连接池及在Spring中的监控配置
- spring boot druid连接池监控配置
- 框架篇-Spring+Mybatis整合Druid连接池,并配置SQL监控
- Druid连接池及监控在Spring配置如下:
- Druid连接池及监控在spring中的配置
- Druid连接池及监控在spring中的配置
- druid连接池监控在spring中的配置
- spring-boot 连接池 druid 的配置及监控
- spring配置druid连接池和监控数据库访问性能
- SpringBoot实践之---Druid连接池的使用和监控配置
- spring-boot 连接池 druid 的配置及监控
- 配置_Druid和Spring关联监控配置
- 15、Spring Boot使用Druid和监控配置【从零开始学Spring Boot】
- Spring Boot 配置Druid关联spring监控
- Spring Boot使用Druid和监控配置方法
- Spring Boot 使用 Druid 和监控配置
- spring boot 配置druid连接池
- Spring中使用Druid连接池配置详解