报错
log4j:WARN No appenders could be found for logger (org.apache.htrace.core.Tracer).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
解决步骤:
1.在src/main/resources目录下创建log4j.properties
右击resource→New→Resource Bundle
name为log4j,不要勾选,直接点击ok
2.创建成功后在里面填写如下内容
hadoop.root.logger=DEBUG, console
log4j.rootLogger = DEBUG, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.target=System.out
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n
3.在main函数中加入文章来源:https://www.toymoban.com/news/detail-595424.html
BasicConfigurator.configure();
4.Rerun一下就可以正常运行了文章来源地址https://www.toymoban.com/news/detail-595424.html
到了这里,关于运行IDEA出现log4j:WARN No appenders could be found for logger (org.apache.hadoop.util.Shell).问题解决方法的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!