Flume 启动时No appenders could be found for logger

安装好了后,启动时报错
flume-ng agent -n agent -c conf -f conf/nxia.conf -Dflume.root.logger=INFO,console

log4j:WARN No appenders could be found for logger (org.apache.flume.node.Application).

不知如何解决,请各位大神赐教

4个回答

我在/home/devps/apache-flume-1.6.0-bin/conf的路径下有log4J.properties
#flume.root.logger=DEBUG,console
flume.root.logger=INFO,LOGFILE
flume.log.dir=./logs
flume.log.file=flume.log

log4j.logger.org.apache.flume.lifecycle = INFO
log4j.logger.org.jboss = WARN
log4j.logger.org.mortbay = INFO
log4j.logger.org.apache.avro.ipc.NettyTransceiver = WARN
log4j.logger.org.apache.hadoop = INFO
log4j.logger.org.apache.hadoop.hive = ERROR

Define the root logger to the system property "flume.root.logger".

log4j.rootLogger=${flume.root.logger}

Stock log4j rolling file appender

Default log rotation configuration

log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.LOGFILE.MaxFileSize=100MB
log4j.appender.LOGFILE.MaxBackupIndex=10
log4j.appender.LOGFILE.File=${flume.log.dir}/${flume.log.file}
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss,SSS} %-5p %t %x - %m%n
。。。。。。

楼主解决了吗?遇到同样的问题~

原因:
flume-ng agent --conf conf --conf-file flume.conf --name a1 -Dflume.root.logger=INFO,console
上面命令在使用参数--conf中没有指定绝对路径。

解决方法,改成下面命令:
flume-ng agent --conf **/opt/apache-flume/conf **--conf-file flume.conf --name a1 -Dflume.root.logger=INFO,console

m0_38103373
m0_38103373 谢大哥,对了
大约 2 年之前 回复

I got this warning when I integrated spring with hibernate.

The solution is:
create a log4j.propertis file under your src directory and add following content:

#begin
log4j.rootLogger=D......
答案就在这里:solution for "log4j:WARN No appenders could be found for logger"
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问