Browse Source

Merge branch '1.1.x'

pull/1635/merge
Andy Wilkinson 11 years ago
parent
commit
31e6044e70
  1. 14
      spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java

14
spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java

@ -90,10 +90,16 @@ public class LogbackLoggingSystem extends AbstractLoggingSystem { @@ -90,10 +90,16 @@ public class LogbackLoggingSystem extends AbstractLoggingSystem {
Assert.notNull(configLocation, "ConfigLocation must not be null");
String resolvedLocation = SystemPropertyUtils.resolvePlaceholders(configLocation);
ILoggerFactory factory = StaticLoggerBinder.getSingleton().getLoggerFactory();
Assert.isInstanceOf(LoggerContext.class, factory,
"LoggerFactory is not a Logback LoggerContext but "
+ "Logback is on the classpath. Either remove Logback "
+ "or the competing implementation (" + factory.getClass() + ")");
Assert.isInstanceOf(
LoggerContext.class,
factory,
String.format(
"LoggerFactory is not a Logback LoggerContext but Logback is on "
+ "the classpath. Either remove Logback or the competing "
+ "implementation (%s loaded from %s).",
factory.getClass(), factory.getClass().getProtectionDomain()
.getCodeSource().getLocation()));
LoggerContext context = (LoggerContext) factory;
context.stop();
context.reset();

Loading…
Cancel
Save