You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flume.apache.org by Hanish Bansal <ha...@gmail.com> on 2014/09/30 11:58:27 UTC

RPC client connection not getting closed in Log4jAppender

Hi All,

I am using Log4jAppender to send the logs on flume agent.

Sample piece of code:
---------------------------

public static void main(String[] args) {
Log log = LogFactory.getLog(LogGenerator.class);
log.info("Writing log message.");
}

log4j.properties file
----------------------------
log4j.rootLogger=INFO,flume
log4j.appender.flume = org.apache.flume.clients.log4jappender.Log4jAppender
log4j.appender.flume.Hostname = 192.168.145.127
log4j.appender.flume.Port = 41414
log4j.appender.flume.UnsafeMode = false
log4j.appender.flume.layout=org.apache.log4j.PatternLayout
log4j.appender.flume.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}
[%-5p] %c{1} - %m%n


After main thread finished, flume client connection is not getting closed
automatically.

Please let me know if we have to define any other configuration to close
the
client connection automaticallty.

-- 
*Thanks & Regards*
*Hanish Bansal*

Re: RPC client connection not getting closed in Log4jAppender

Posted by Hanish Bansal <ha...@gmail.com>.
Yeah sure.

Currently I have to use System.exit(0) statement to terminate main thread.

Thanks !!

Regards,
Hanish
On 30/09/2014 9:27 pm, "Hari Shreedharan" <hs...@cloudera.com> wrote:

> That looks like a bug. Can you please file a jira?
>
> Thanks,
> Hari
>
>
> On Tue, Sep 30, 2014 at 2:58 AM, Hanish Bansal <
> hanish.bansal.agarwal@gmail.com> wrote:
>
>>  Hi All,
>>
>> I am using Log4jAppender to send the logs on flume agent.
>>
>> Sample piece of code:
>> ---------------------------
>>
>> public static void main(String[] args) {
>> Log log = LogFactory.getLog(LogGenerator.class);
>> log.info("Writing log message.");
>> }
>>
>> log4j.properties file
>> ----------------------------
>> log4j.rootLogger=INFO,flume
>> log4j.appender.flume =
>> org.apache.flume.clients.log4jappender.Log4jAppender
>> log4j.appender.flume.Hostname = 192.168.145.127
>> log4j.appender.flume.Port = 41414
>> log4j.appender.flume.UnsafeMode = false
>> log4j.appender.flume.layout=org.apache.log4j.PatternLayout
>> log4j.appender.flume.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}
>> [%-5p] %c{1} - %m%n
>>
>>
>> After main thread finished, flume client connection is not getting closed
>> automatically.
>>
>> Please let me know if we have to define any other configuration to close
>> the
>> client connection automaticallty.
>>
>> --
>> *Thanks & Regards*
>> *Hanish Bansal*
>>
>
>

Re: RPC client connection not getting closed in Log4jAppender

Posted by Hari Shreedharan <hs...@cloudera.com>.
That looks like a bug. Can you please file a jira?


Thanks,
Hari

On Tue, Sep 30, 2014 at 2:58 AM, Hanish Bansal
<ha...@gmail.com> wrote:

> Hi All,
> I am using Log4jAppender to send the logs on flume agent.
> Sample piece of code:
> ---------------------------
> public static void main(String[] args) {
> Log log = LogFactory.getLog(LogGenerator.class);
> log.info("Writing log message.");
> }
> log4j.properties file
> ----------------------------
> log4j.rootLogger=INFO,flume
> log4j.appender.flume = org.apache.flume.clients.log4jappender.Log4jAppender
> log4j.appender.flume.Hostname = 192.168.145.127
> log4j.appender.flume.Port = 41414
> log4j.appender.flume.UnsafeMode = false
> log4j.appender.flume.layout=org.apache.log4j.PatternLayout
> log4j.appender.flume.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss}
> [%-5p] %c{1} - %m%n
> After main thread finished, flume client connection is not getting closed
> automatically.
> Please let me know if we have to define any other configuration to close
> the
> client connection automaticallty.
> -- 
> *Thanks & Regards*
> *Hanish Bansal*