我建立了一个demo项目,目录结构如下:
类的代码:
package com.asiainfo.firstmaven.helloworld;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class HelloWorld {
String sayHello() {
return "Hello World";
}
public static void main(String[] args) {
Logger logger = LogManager.getLogger(HelloWorld.class);
logger.debug("I am a debug");
logger.error("I am a error");
logger.warn("I am a warn");
logger.info("I am a info");
System.out.println(new HelloWorld().sayHello());
}
}
运行总是报错:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
是哪里还需要配置吗? 跪求解答..
婷婷同学_
相关分类