Commit 8280004f authored by Phillip Webb's avatar Phillip Webb

Fix ClasspathLoggingApplicationListener order

Commit 3de25164 inadvertently caused early debug logging from the
ClasspathLoggingApplicationListener. We now set its order relative
to the LoggingApplicationListener.

See gh-2543
parent eeb947b3
...@@ -26,7 +26,6 @@ import org.springframework.boot.context.event.ApplicationStartedEvent; ...@@ -26,7 +26,6 @@ import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationEvent;
import org.springframework.context.event.GenericApplicationListener; import org.springframework.context.event.GenericApplicationListener;
import org.springframework.context.event.SmartApplicationListener; import org.springframework.context.event.SmartApplicationListener;
import org.springframework.core.Ordered;
import org.springframework.core.ResolvableType; import org.springframework.core.ResolvableType;
/** /**
...@@ -40,7 +39,7 @@ import org.springframework.core.ResolvableType; ...@@ -40,7 +39,7 @@ import org.springframework.core.ResolvableType;
public final class ClasspathLoggingApplicationListener implements public final class ClasspathLoggingApplicationListener implements
GenericApplicationListener { 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()); private final Log logger = LogFactory.getLog(getClass());
......
...@@ -64,6 +64,11 @@ import org.springframework.util.StringUtils; ...@@ -64,6 +64,11 @@ import org.springframework.util.StringUtils;
*/ */
public class LoggingApplicationListener implements GenericApplicationListener { 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 * The name of the Spring property that contains a reference to the logging
* configuration to load. * configuration to load.
...@@ -109,7 +114,7 @@ public class LoggingApplicationListener implements GenericApplicationListener { ...@@ -109,7 +114,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
private LoggingSystem loggingSystem; private LoggingSystem loggingSystem;
private int order = Ordered.HIGHEST_PRECEDENCE + 20; private int order = DEFAULT_ORDER;
private boolean parseArgs = true; private boolean parseArgs = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment