Example usage for org.springframework.boot.diagnostics FailureAnalysis getAction

List of usage examples for org.springframework.boot.diagnostics FailureAnalysis getAction

Introduction

In this page you can find the example usage for org.springframework.boot.diagnostics FailureAnalysis getAction.

Prototype

public String getAction() 

Source Link

Document

Returns the action, if any, to be taken to address the failure.

Usage

From source file:org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter.java

private String buildMessage(FailureAnalysis failureAnalysis) {
    StringBuilder builder = new StringBuilder();
    builder.append(String.format("%n%n"));
    builder.append(String.format("***************************%n"));
    builder.append(String.format("APPLICATION FAILED TO START%n"));
    builder.append(String.format("***************************%n%n"));
    builder.append(String.format("Description:%n%n"));
    builder.append(String.format("%s%n", failureAnalysis.getDescription()));
    if (StringUtils.hasText(failureAnalysis.getAction())) {
        builder.append(String.format("%nAction:%n%n"));
        builder.append(String.format("%s%n", failureAnalysis.getAction()));
    }//w w  w .  j ava  2 s  .com
    return builder.toString();
}