下载Jar包[b]javamelody-1.37.0.jar[/b] 和 [b]jrobin-1.5.9.1.jar [/b]
JavaMelody开源项目地址:http://code.google.com/p/javamelody/
把两个jar包放到项目WEB-INF\lib下面。
配制web.xml(添加一个filter和一个listener),代码如下:
web.xml
<!-- 系统监控 -->
<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>
运行项目,即可启动监控页面.
比如说我的应用访问路径为:http://localhost:8080/jingang
可以通过[b]http://localhost:8080/jingang/monitoring?period=jour[/b]来访问监控页面.
JavaMelody开源项目地址:http://code.google.com/p/javamelody/
把两个jar包放到项目WEB-INF\lib下面。
配制web.xml(添加一个filter和一个listener),代码如下:
web.xml
<!-- 系统监控 -->
<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>
运行项目,即可启动监控页面.
比如说我的应用访问路径为:http://localhost:8080/jingang
可以通过[b]http://localhost:8080/jingang/monitoring?period=jour[/b]来访问监控页面.