Gra*_*ant 8 java logging log4j apache-commons log4j2
我想使用log4j2 Commons Logging Bridge with commons 1.2.我尝试使用如下内容:
import org.apache.logging.log4j.jcl.LogFactoryImpl;
public class MyClass{
private static Log log = LogFactoryImpl.getLog(DropinsBundleDeployer.class);
.
.
.
log.error("Error occured", e);
}
Run Code Online (Sandbox Code Playgroud)
但是当我运行代码时,我遇到了问题并且看不到任何日志:
log4j:WARN Please initialize the log4j system properly.
Run Code Online (Sandbox Code Playgroud)
但是log4j2.xml文件位于类路径中.如何使用log4j2正确使用commons logging 1.2?