整合SSH后,项目本身没有报错,但一运行就提示tomcat打开失败并报错,在网上查了很多资料,终于找到解决方案:在项目右键Build Path打开后在如图的位置添加一个“log4j2.xml”的文件即可解决问题(log4j2.xml代码在文末)

Myeclipse2017提示:ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j

Myeclipse2017提示:ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j

 

log4j2.xml代码如下:

<?xml version="1.0" encoding="UTF-8"?>

<Configuration status="warn">  
            <Appenders>  
                        <Console name="Console" target="SYSTEM_OUT">  
                                    <PatternLayout pattern="[%-5p] %d %c - %m%n" />  
                        </Console>  
                        <File name="File" fileName="dist/my.log">  
                                    <PatternLayout pattern="%m%n" />  
                        </File>  
            </Appenders>  
  
            <Loggers>  
                        <Logger name="mh.sample2.Log4jTest2" level="INFO">  
                                    <AppenderRef ref="File" />  
                        </Logger>  
                        <Root level="INFO">  
                                    <AppenderRef ref="Console" />  
                        </Root>  
            </Loggers>  
</Configuration>  

相关文章:

  • 2021-04-12
  • 2021-09-20
  • 2021-05-17
  • 2021-05-03
  • 2021-04-05
  • 2021-04-02
  • 2021-09-29
  • 2021-10-10
猜你喜欢
  • 2021-06-18
  • 2021-04-30
  • 2021-10-02
  • 2021-05-07
  • 2021-04-20
  • 2022-01-18
  • 2021-09-27
相关资源
相似解决方案