一、描述
log4j:WARN No appenders could be found for logger (org.apache.flink.table.module.ModuleManager)
二、分析
1、添加-Dlog4j.debug参数,打印如下信息
log4j: Trying to find [log4j.xml] using context classloader sun.misc.Launcher$AppClassLoader@18b4aac2.
log4j: Trying to find [log4j.xml] using sun.misc.Launcher$AppClassLoader@18b4aac2 class loader.
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader sun.misc.Launcher$AppClassLoader@18b4aac2.
log4j: Trying to find [log4j.properties] using sun.misc.Launcher$AppClassLoader@18b4aac2 class loader.
log4j: Trying to find [log4j.properties] using ClassLoader.getSystemResource().
log4j: Could not find resource: [null].
log4j:WARN No appenders could be found for logger (org.apache.flink.api.java.ClosureCleaner).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
三、解决方法
先配置log4j.properties,如果还不行,那在main方法中添加BasicConfigurator.configure();,如果还不行,通过代码设置org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.ERROR);
四、参考文章
1、https://stackoverflow.com/questions/1509324/log4j-basic-configuration
注意:本文归作者所有,未经作者允许,不得转载