依赖包:
1 23 8 9org.apache.logging.log4j 4log4j-api 52.11.1 6provided 710 org.apache.logging.log4j 11log4j-core 122.11.1 13provided 14
log4j2.xml配置文件:(该配置文件需要放到resources目录下)
使用代码范例:
private static Logger logger = LogManager.getLogger(test.class);...public void XXX(){ ... logger.debug("XXX");}