Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Flume >> mail # user >> Log4jAppender dosn't work for log4j.rootLogger


Copy link to this message
-
Re: Log4jAppender dosn't work for log4j.rootLogger
Can you share your demo program, log4j.properties, and flume properties?
Pastebin is a good place to dump these as the mailing list does not let you
attach files.

Brock

On Sun, Oct 21, 2012 at 8:20 PM, Huang Tonglang <[EMAIL PROTECTED]> wrote:

>  Could someone help me out. I am really confusing now.****
>
> ** **
>
> It works fine for below configuration:****
>
> log4j.appender.flume = org.apache.flume.clients.log4jappender.Log4jAppender
> ****
>
> log4j.appender.flume.Hostname = 172.18.9.182****
>
> log4j.appender.flume.Port = 4141****
>
> log4j.logger.test.spring.Demo = DEBUG,flume****
>
> ** **
>
> ** **
>
> However, if I configure flume appender for root logger like below, there
> will be an exception:****
>
> log4j.rootLogger=DEBUG, flume****
>
> ** **
>
> ** **
>
> ** **
>
> log4j:WARN No appenders could be found for logger
> (org.apache.flume.api.NettyAvroRpcClient).****
>
> 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:ERROR Flume append() failed.****
>
> *org.apache.flume.EventDeliveryException*: NettyAvroRpcClient { host:
> pearl-diver-test.appl.800best.com, port: 4141 }: Failed to send event****
>
>     at org.apache.flume.api.NettyAvroRpcClient.append(*
> NettyAvroRpcClient.java:171*)****
>
>     at org.apache.flume.clients.log4jappender.Log4jAppender.append(*
> Log4jAppender.java:128*)****
>
>     at org.apache.log4j.AppenderSkeleton.doAppend(*
> AppenderSkeleton.java:251*)****
>
>     at
> org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(*
> AppenderAttachableImpl.java:66*)****
>
>     at org.apache.log4j.Category.callAppenders(*Category.java:206*)****
>
>     at org.apache.log4j.Category.forcedLog(*Category.java:391*)****
>
>     at org.apache.log4j.Category.log(*Category.java:856*)****
>
>     at org.slf4j.impl.Log4jLoggerAdapter.log(*Log4jLoggerAdapter.java:602*
> )****
>
>     at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(*
> SLF4JLocationAwareLog.java:159*)****
>
>     at test.spring.Demo.main(*Demo.java:17*)****
>
> Caused by: *org.apache.flume.EventDeliveryException*: NettyAvroRpcClient
> { host: pearl-diver-test.appl.800best.com, port: 4141 }: Handshake timed
> out after 20000 ms****
>
>     at org.apache.flume.api.NettyAvroRpcClient.append(*
> NettyAvroRpcClient.java:204*)****
>
>     at org.apache.flume.api.NettyAvroRpcClient.append(*
> NettyAvroRpcClient.java:159*)****
>
>     ... 9 more****
>
> Caused by: *java.util.concurrent.TimeoutException*****
>
>     at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)****
>
>     at java.util.concurrent.FutureTask.get(Unknown Source)****
>
>     at org.apache.flume.api.NettyAvroRpcClient.append(*
> NettyAvroRpcClient.java:202*)****
>
>     ... 10 more****
>
> Exception in thread "main" *org.apache.flume.FlumeException*: Flume
> append() failed. Exception follows.****
>
>     at org.apache.flume.clients.log4jappender.Log4jAppender.append(*
> Log4jAppender.java:134*)****
>
>     at org.apache.log4j.AppenderSkeleton.doAppend(*
> AppenderSkeleton.java:251*)****
>
>     at
> org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(*
> AppenderAttachableImpl.java:66*)****
>
>     at org.apache.log4j.Category.callAppenders(*Category.java:206*)****
>
>     at org.apache.log4j.Category.forcedLog(*Category.java:391*)****
>
>     at org.apache.log4j.Category.log(*Category.java:856*)****
>
>     at org.slf4j.impl.Log4jLoggerAdapter.log(*Log4jLoggerAdapter.java:602*
> )****
>
>     at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(*
> SLF4JLocationAwareLog.java:159*)****
>
>     at test.spring.Demo.main(*Demo.java:17*)****
>
> Caused by: *org.apache.flume.EventDeliveryException*: NettyAvroRpcClient
> { host: pearl-diver-test.appl.800best.com, port: 4141 }: Failed to send
> event****
>
>     at org.apache.flume.api.NettyAvroRpcClient.append(*
> NettyAvroRpcClient.java:171*)****
>
>     at org.apache.flume.clients.log4jappender.Log4jAppender.append(*

Apache MRUnit - Unit testing MapReduce - http://incubator.apache.org/mrunit/