Home / Function/ reportConfigurationErrorsIfNecessary() — spring-boot Function Reference

reportConfigurationErrorsIfNecessary() — spring-boot Function Reference

Architecture documentation for the reportConfigurationErrorsIfNecessary() function in LogbackLoggingSystem.java from the spring-boot codebase.

Function java GradlePlugin DslExtensions calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  19da2568_f743_7d19_1cd4_f1307cfec4c9["reportConfigurationErrorsIfNecessary()"]
  7d5d754c_bca4_3cde_00f3_cbf533d9a055["initializeFromAotGeneratedArtifactsIfPossible()"]
  7d5d754c_bca4_3cde_00f3_cbf533d9a055 -->|calls| 19da2568_f743_7d19_1cd4_f1307cfec4c9
  cafc9a8c_e23a_b8c4_5c44_2f02f0d89617["loadConfiguration()"]
  cafc9a8c_e23a_b8c4_5c44_2f02f0d89617 -->|calls| 19da2568_f743_7d19_1cd4_f1307cfec4c9
  24c0fbca_1c0a_587d_aae0_6001704c3181["getLevel()"]
  19da2568_f743_7d19_1cd4_f1307cfec4c9 -->|calls| 24c0fbca_1c0a_587d_aae0_6001704c3181
  style 19da2568_f743_7d19_1cd4_f1307cfec4c9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java lines 277–299

	private void reportConfigurationErrorsIfNecessary(LoggerContext loggerContext) {
		StringBuilder errors = new StringBuilder();
		List<Throwable> suppressedExceptions = new ArrayList<>();
		for (Status status : loggerContext.getStatusManager().getCopyOfStatusList()) {
			if (status.getLevel() == Status.ERROR) {
				errors.append((!errors.isEmpty()) ? String.format("%n") : "");
				errors.append(status);
				if (status.getThrowable() != null) {
					suppressedExceptions.add(status.getThrowable());
				}
			}
		}
		if (errors.isEmpty()) {
			if (!StatusUtil.contextHasStatusListener(loggerContext)) {
				this.statusPrinter.printInCaseOfErrorsOrWarnings(loggerContext);
			}
			return;
		}
		IllegalStateException ex = new IllegalStateException(
				String.format("Logback configuration error detected: %n%s", errors));
		suppressedExceptions.forEach(ex::addSuppressed);
		throw ex;
	}

Domain

Subdomains

Calls

Frequently Asked Questions

What does reportConfigurationErrorsIfNecessary() do?
reportConfigurationErrorsIfNecessary() is a function in the spring-boot codebase.
What does reportConfigurationErrorsIfNecessary() call?
reportConfigurationErrorsIfNecessary() calls 1 function(s): getLevel.
What calls reportConfigurationErrorsIfNecessary()?
reportConfigurationErrorsIfNecessary() is called by 2 function(s): initializeFromAotGeneratedArtifactsIfPossible, loadConfiguration.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free