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
pull/3706/head
Phillip Webb 9 years ago
parent eeb947b382
commit 8280004f80

@ -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;
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;
*/ */
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 {
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;

Loading…
Cancel
Save