@ -41,7 +41,6 @@ import org.slf4j.impl.StaticLoggerBinder;
import org.springframework.boot.logging.LogFile ;
import org.springframework.boot.logging.LogLevel ;
import org.springframework.boot.logging.LoggerConfiguration ;
import org.springframework.boot.logging.LoggerConfigurationComparator ;
import org.springframework.boot.logging.LoggingInitializationContext ;
import org.springframework.boot.logging.LoggingSystem ;
import org.springframework.boot.logging.Slf4JLoggingSystem ;
@ -59,9 +58,6 @@ import org.springframework.util.StringUtils;
* /
public class LogbackLoggingSystem extends Slf4JLoggingSystem {
private static final LoggerConfigurationComparator COMPARATOR = new LoggerConfigurationComparator (
Logger . ROOT_LOGGER_NAME ) ;
private static final String CONFIGURATION_FILE_PROPERTY = "logback.configurationFile" ;
private static final LogLevels < Level > LEVELS = new LogLevels < Level > ( ) ;
@ -219,7 +215,7 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
for ( ch . qos . logback . classic . Logger logger : getLoggerContext ( ) . getLoggerList ( ) ) {
result . add ( getLoggerConfiguration ( logger ) ) ;
}
Collections . sort ( result , CO MPARATOR) ;
Collections . sort ( result , CO NFIGURATION_CO MPARATOR) ;
return result ;
}
@ -236,7 +232,11 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
LogLevel level = LEVELS . convertNativeToSystem ( logger . getLevel ( ) ) ;
LogLevel effectiveLevel = LEVELS
. convertNativeToSystem ( logger . getEffectiveLevel ( ) ) ;
return new LoggerConfiguration ( logger . getName ( ) , level , effectiveLevel ) ;
String name = logger . getName ( ) ;
if ( ! StringUtils . hasLength ( name ) | | Logger . ROOT_LOGGER_NAME . equals ( name ) ) {
name = ROOT_LOGGER_NAME ;
}
return new LoggerConfiguration ( name , level , effectiveLevel ) ;
}
@Override
@ -259,7 +259,9 @@ public class LogbackLoggingSystem extends Slf4JLoggingSystem {
private ch . qos . logback . classic . Logger getLogger ( String name ) {
LoggerContext factory = getLoggerContext ( ) ;
name = ( StringUtils . isEmpty ( name ) ? Logger . ROOT_LOGGER_NAME : name ) ;
if ( StringUtils . isEmpty ( name ) | | ROOT_LOGGER_NAME . equals ( name ) ) {
name = Logger . ROOT_LOGGER_NAME ;
}
return factory . getLogger ( name ) ;
}