Javamelody 监控java web项目配置

一、 pom.xml

<dependency>
<groupId>net.bull.javamelodygroupId>
<artifactId>javamelody-coreartifactId>
<version>1.47.0version>
dependency>
<dependency>
<groupId>org.jrobingroupId>
<artifactId>jrobinartifactId>
<version>1.5.9version>
dependency>
二、 web.xml

<filter>
<filter-name>monitoringfilter-name>
<filter-class>net.bull.javamelody.MonitoringFilterfilter-class>
<init-param>
<param-name>logparam-name>
<param-value>trueparam-value>
init-param>
filter>
<filter-mapping>
<filter-name>monitoringfilter-name>
<url-pattern>/*url-pattern>
filter-mapping>
<listener>
<listener-class>net.bull.javamelody.SessionListenerlistener-class>
listener>
三、新增spring配置文件  trade-monitoring.xml
xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">

<bean id="springDataSourceBeanPostProcessor" class="net.bull.javamelody.SpringDataSourceBeanPostProcessor">

bean>

<bean id="wrappedDataSource" class="net.bull.javamelody.SpringDataSourceFactoryBean">
<property name="targetName" value="datasource" /> -- 数据源
bean>
beans>
四、修改  application-context.xml

< import  resource= "classpath:spring/trade-monitoring.xml" />
<import resource="classpath:net/bull/javamelody/monitoring-spring.xml"/>


<bean id="monitoringAdvisor" class="net.bull.javamelody.MonitoringSpringAdvisor">
<property name="pointcut">
<bean class="net.bull.javamelody.MonitoredWithAnnotationPointcut"/>
property>
bean>

 
   
 
  

你可能感兴趣的:(Javamelody 监控java web项目配置)