diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/ClasspathLoggingApplicationListener.java b/spring-boot/src/main/java/org/springframework/boot/logging/ClasspathLoggingApplicationListener.java index 2e8b272993..051f93af23 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/ClasspathLoggingApplicationListener.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/ClasspathLoggingApplicationListener.java @@ -26,7 +26,6 @@ import org.springframework.boot.context.event.ApplicationStartedEvent; import org.springframework.context.ApplicationEvent; import org.springframework.context.event.GenericApplicationListener; import org.springframework.context.event.SmartApplicationListener; -import org.springframework.core.Ordered; import org.springframework.core.ResolvableType; /** @@ -40,7 +39,7 @@ import org.springframework.core.ResolvableType; public final class ClasspathLoggingApplicationListener implements GenericApplicationListener { - private static final int ORDER = Ordered.HIGHEST_PRECEDENCE + 12; + private static final int ORDER = LoggingApplicationListener.DEFAULT_ORDER + 1; private final Log logger = LogFactory.getLog(getClass()); diff --git a/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java b/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java index d89783a947..7d3612fcee 100644 --- a/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java +++ b/spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java @@ -64,6 +64,11 @@ import org.springframework.util.StringUtils; */ public class LoggingApplicationListener implements GenericApplicationListener { + /** + * The default order for the LoggingApplicationListener. + */ + public static final int DEFAULT_ORDER = Ordered.HIGHEST_PRECEDENCE + 20; + /** * The name of the Spring property that contains a reference to the logging * configuration to load. @@ -109,7 +114,7 @@ public class LoggingApplicationListener implements GenericApplicationListener { private LoggingSystem loggingSystem; - private int order = Ordered.HIGHEST_PRECEDENCE + 20; + private int order = DEFAULT_ORDER; private boolean parseArgs = true;