ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath
问题描述:
Struts2框架导入项目时使用了min版本下的jar,项目编写初期没有错误,加入文件上传下载后出现“ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath”
问题解决方案:
下载对应版本的jar并导入
然后需要在Src目录下创建配置文件log4j2.xml:
<?xml version="1.0" encoding="UTF-8"?> <Configuration status="WARN"> <Appenders> <Console name="Console" target="SYSTEM_OUT"> <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/> </Console> </Appenders> <Loggers> <Root level="info"> <AppenderRef ref="Console"/> </Root> </Loggers> </Configuration>
重启服务器后项目正常运行