From bd6edeaa9417605d3338c2e011b56df30ffac065 Mon Sep 17 00:00:00 2001 From: Tim Grohmann Date: Mon, 5 Feb 2024 14:51:22 +0100 Subject: [PATCH] Allow creation of SpringProfileArbiter without Environment See gh-39403 --- .../boot/logging/log4j2/SpringProfileArbiter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java index 6aa7f5421af..62d63416cab 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/SpringProfileArbiter.java @@ -95,8 +95,7 @@ final class SpringProfileArbiter implements Arbiter { public SpringProfileArbiter build() { Environment environment = Log4J2LoggingSystem.getEnvironment(this.loggerContext); if (environment == null) { - statusLogger.warn("Cannot create Arbiter, no Spring Environment available"); - return null; + statusLogger.debug("Creating Arbiter without a Spring Environment"); } String name = this.configuration.getStrSubstitutor().replace(this.name); String[] profiles = StringUtils.trimArrayElements(StringUtils.commaDelimitedListToStringArray(name));