美文网首页
javamelody部署监控

javamelody部署监控

作者: whisperoy | 来源:发表于2019-03-14 12:00 被阅读0次

    依赖

    <dependency>
               <groupId>net.bull.javamelody</groupId>
               <artifactId>javamelody-core</artifactId>
               <version>1.72.0</version>
     </dependency>
    

    注入bean

    @Configuration
    public class JavamelodyConfiguration {
        
        @Bean
        public FilterRegistrationBean monitorFilter() {
            FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new MonitoringFilter());
            filterRegistrationBean.addUrlPatterns("/*");
            return filterRegistrationBean;
        }
    
        @Bean
        public ServletListenerRegistrationBean sessionListener() {
            ServletListenerRegistrationBean servletListenerRegistrationBean = new ServletListenerRegistrationBean();
            servletListenerRegistrationBean.setListener(new SessionListener());
            return servletListenerRegistrationBean;
        }
    }
    

    相关文章

      网友评论

          本文标题:javamelody部署监控

          本文链接:https://www.haomeiwen.com/subject/xpqaeqtx.html