javamelody监控工具简单部署

运行环境

tomcat 9

jdk 8

servlet 3.1

部署项目

maven war包


1.从maven库导入相关jar包

<!-- javamelody监控依赖包 -->

<dependency>

    <groupId>net.bull.javamelody</groupId>

    <artifactId>javamelody-core</artifactId>

    <version>1.62.0</version>

</dependency>


2. 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"

  metadata-complete="true">

  

  <!-- javamelody监控 -->

  <filter>

    <filter-name>monitoring</filter-name>

    <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>

  </filter>

  <filter-mapping>

    <filter-name>monitoring</filter-name>

    <url-pattern>/*</url-pattern>

  </filter-mapping>

  <listener>

    <listener-class>net.bull.javamelody.SessionListener</listener-class>

  </listener>

  <display-name>javamelody</display-name>

  <welcome-file-list>

    <welcome-file>index.html</welcome-file>

  </welcome-file-list>

</web-app>


3.启动项目访问 http://localhost:8080/javamelody/monitoring?








评论

© dzxlovelar | Powered by LOFTER