Log4j2 could not find a logging implementation with Spring Boot

后端 未结 4 2112
走了就别回头了
走了就别回头了 2020-12-18 00:02

I\'m getting this error trying to use log4j2 with spring boot.

ERROR StatusLogger Log4j2 could not find a logging implementation. 
Please add log4j-core to t         


        
4条回答
  •  一个人的身影
    2020-12-18 00:24

    That error message is generated by the log4j-api module when it cannot find or load an implementation of its interfaces. Usually this means that the log4j-core module is missing from the classpath, but looking at your dependency graph that doesn't seem to be the case.

    There are some transitive dependencies on the log4j-slf4j-impl and log4j-jul modules but I don't think that could cause the error message.

    One way to investigate further is to try starting your application again with this system property set: -Dorg.apache.logging.log4j.simplelog.StatusLogger.level=TRACE. This will print log4j internal debug logging to the console.

    (Once your configuration file is loaded the StatusLogger output level can be controlled by setting in the beginning of the log4j2.xml configuration file. However, the configuration file is loaded by the log4j-core module, and we're not there yet...)

提交回复
热议问题