springboot之FailureAnalyzer-古蔺大橙子建站
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
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
URL链接:http://scgulin.cn/article/ijeihd.html