javamelody服务监控
配置服务监控
1.pox.xml
<dependency> <groupId>net.bull.javamelody</groupId> <artifactId>javamelody-core</artifactId> <version>1.71.0</version> </dependency>
2.web.xml(必须放在servlet坚挺的前面)
<!--服务监控--> <filter-mapping> <filter-name>javamelody</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>ASYNC</dispatcher> </filter-mapping> <listener> <listener-class>net.bull.javamelody.SessionListener</listener-class> </listener>
3.spring.xml
<import resource="classpath:net/bull/javamelody/monitoring-spring-datasource.xml" /> <bean id="facadeMonitoringAdvisor" class="net.bull.javamelody.MonitoringSpringAdvisor"> <property name="pointcut"> <bean class="org.springframework.aop.support.JdkRegexpMethodPointcut"> <property name="pattern" value="com.supermap.*.service.*" /> </bean> </property> </bean>
4.访问的地址
欢迎关注,一个注在共享、交流的Java学习平台。