NutzCN Logo
问答 druid监控不到执行的sql
发布于 1591天前 作者 junk123321 2582 次浏览 复制 上一个帖子 下一个帖子
标签:

sql监控页面(http://localhost:8080/druid/sql.html)能打开
该页面一直发送sql.json请求 http://localhost:8080/druid/sql.json?orderBy=SQL&orderType=desc&page=1&perPageCount=1000000&
服务端日志显示

[DEBUG] 00:04:53.509 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:110)
 - Search mapping for [POST] path=/sql : NOT Action match

web.xml内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
    <display-name>Archetype Created Web Application</display-name>
    <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>

    <filter>
        <filter-name>nutz</filter-name>
        <filter-class>org.nutz.mvc.NutFilter</filter-class>
        <init-param>
            <param-name>modules</param-name>
            <param-value>demo.hello.MainModule</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>nutz</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

    <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>
</web-app>
2 回复

没有影响的

druid监控还得配数据源的filters属性

谢谢!

    dataSource: {
        type: "com.alibaba.druid.pool.DruidDataSource",
        events: {
            depose: 'close'
        },
        fields: {
            url: "jdbc:mysql://...",
            username: "...",
            password: "...",
            filters: "stat" // 打开 druid monitor
        }
    },
添加回复
请先登陆
回到顶部