运行程序,报以下警告:
log4j:WARN No appenders could be found for logger (..). log4j:WARN Please initialize the log4j system properly.
* 其中的“..”是某个包的名字,例如org.apache.flume.api.AbstractRpcClient
解决方法:
在src/main/java/resources目录中添加log4j.properties文件,并加入以下内容:
log4j.rootLogger=debug, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n