资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

springboot之FailureAnalyzer

FailedAnalyzer 自定义实现

创新互联 - 达州电信机房,四川服务器租用,成都服务器租用,四川网通托管,绵阳服务器托管,德阳服务器托管,遂宁服务器托管,绵阳服务器托管,四川云主机,成都云主机,西南云主机,达州电信机房,西南服务器托管,四川/成都大带宽,大带宽服务器,四川老牌IDC服务商

import org.springframework.boot.diagnostics.FailureAnalysis;
import org.springframework.boot.diagnostics.FailureAnalyzer;
/**
 * Created by JavaDeveloperZone on 03-05-2018.
 * Here we have implements FailureAnalyzer and override analyze method which will be
 * called automatically when application startup will get failed.
 */
public class CustomFailedAnalyzer implements FailureAnalyzer {
    @Override
    public FailureAnalysis analyze(Throwable failure) {
        return new FailureAnalysis("Custom Failed Message : ",failure.getMessage(),failure);
    }
}

spring.factories文件配置

org.springframework.boot.diagnostics.FailureAnalyzer=com.javadeveloperzone.CustomFailedAnalyzer

注意:必须放置在resources/META-INF
spring boot之FailureAnalyzer

原文地址:https://javadeveloperzone.com/spring-boot/spring-boot-startup-failure-analyzer-example/


网站标题:springboot之FailureAnalyzer
当前网址:http://cdkjz.cn/article/ijeihd.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220