I configured slf4j and morphia in the project
<dependency>
<groupId>org.mongodb.morphia</groupId>
<artifactId>morphia</artifactId>
<version>1.3.1</version>
</dependency>
<!-- slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.5</version>
</dependency>
Log configuration is as follows
private static Logger logger = LoggerFactory.getLogger(MongodbTest.class);
/**
*
*/
@Test
public void testSlf4j(){
logger.debug("lalalala");
logger.warn("lalala");
logger.info("lalala");
}
the following is the output
23, 2018 3:59:18 org.mongodb.morphia.logging.MorphiaLoggerFactory chooseLoggerFactory
: LoggerImplFactory set to org.mongodb.morphia.logging.jdk.JDKLoggerFactory
[main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [springconfig.xml]
[main] INFO org.springframework.context.support.GenericApplicationContext - Refreshing org.springframework.context.support.GenericApplicationContext@9597028: startup date [Mon Apr 23 15:59:19 CST 2018]; root of context hierarchy
[main] WARN shenzhen.MongodbTest - lalala
[main] INFO shenzhen.MongodbTest - lalala
Why did slf4j choose morphia logs instead of slf4j simple logs