diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/SpringBootJoranConfigurator.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/SpringBootJoranConfigurator.java index cec2a5209d..3b47df87be 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/SpringBootJoranConfigurator.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/SpringBootJoranConfigurator.java @@ -55,6 +55,7 @@ import org.springframework.aot.hint.TypeReference; import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution; import org.springframework.beans.factory.aot.BeanFactoryInitializationCode; import org.springframework.boot.logging.LoggingInitializationContext; +import org.springframework.core.CollectionFactory; import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; @@ -320,7 +321,7 @@ class SpringBootJoranConfigurator extends JoranConfigurator { } private InputStream asInputStream(Map patternRuleRegistry) { - Properties properties = new Properties(); + Properties properties = CollectionFactory.createSortedProperties(true); patternRuleRegistry.forEach(properties::setProperty); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); try {