No appenders could be found for logger

在运行代码时,出现下面的错误,

log4j:WARN No appenders could be found for logger (genericTest.GenericTest).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

解决方法是在pom.xml中添加下面的依赖:

 <dependency> 
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-1.2-api</artifactId>
      <version>2.8.2</version>
   </dependency>

参考网址

https://blog.csdn.net/u013412790/article/details/76983788  

 

上一篇:mysql


下一篇:05 Java的ReentrantLock与线程的顺序控制