Skip to content

Commit 3002779

Browse files
sdeleuzephilwebb
authored andcommitted
Remove LogbackConfigurationAotContribution from native image
Remove `LogbackConfigurationAotContribution` from the reachable code path from a native image POV. See gh-32793
1 parent fb736e8 commit 3002779

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/SpringBootJoranConfigurator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import org.springframework.beans.factory.aot.BeanFactoryInitializationCode;
5757
import org.springframework.boot.logging.LoggingInitializationContext;
5858
import org.springframework.core.CollectionFactory;
59+
import org.springframework.core.NativeDetector;
5960
import org.springframework.core.io.ByteArrayResource;
6061
import org.springframework.core.io.ClassPathResource;
6162
import org.springframework.core.io.Resource;
@@ -110,7 +111,7 @@ boolean configureUsingAotGeneratedArtifacts() {
110111
@Override
111112
public void processModel(Model model) {
112113
super.processModel(model);
113-
if (isAotProcessingInProgress()) {
114+
if (!NativeDetector.inNativeImage() && isAotProcessingInProgress()) {
114115
getContext().putObject(BeanFactoryInitializationAotContribution.class.getName(),
115116
new LogbackConfigurationAotContribution(model,
116117
getModelInterpretationContext().getBeanDescriptionCache(),

0 commit comments

Comments
 (0)