shell下使用log4j 1.x “No appenders could be found for logger”问题两个处理办法

阅读更多

错误:

log4j:WARN No appenders could be found for logger (org.apache.flink.core.fs.FileSystem).

log4j:WARN Please initialize the log4j system properly.

log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

 

 

现象:

不打印log

 

方法一,通过classpath指定log4j.properties配置文件路径(是路径!)

java -classpath /path_include_log4j/conf

 

方法二,通过log4j.configuration指定文件路径,通过替换log4j文件占位符

java -Dlog.file=/tmp/local_debug.log -Dlog4j.configuration=file:////path_include_log4j/conf/log4j.properties

 

注意:方法二必须file://开头 

你可能感兴趣的:(shell下使用log4j 1.x “No appenders could be found for logger”问题两个处理办法)