logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remko Popma <remko.po...@gmail.com>
Subject Re: Non blocking JMS appender
Date Wed, 02 Apr 2014 23:58:29 GMT
Your main goal is probably to have the IO (the jms messaging) in a separate thread from your
application. An async appender achieves that. 

However AsyncAppender uses a normal java queue to pass log events from one thread to another.
This is a blocking data structure and can become a source of contention if many application
threads are logging concurrently. 

Log4j-2.0 offers an alternative with async loggers that you may be interested in: http://logging.apache.org/log4j/2.x/manual/async.html

Remko

Sent from my iPhone

> On 2014/04/03, at 8:20, Matt Sicker <boards@gmail.com> wrote:
> 
> It would be in log4j2! As far as I know, that is.
> 
> 
>> On 2 April 2014 12:00, Mohit Anchlia <mohitanchlia@gmail.com> wrote:
>> 
>> I am trying to configure log4j such that the jms appender is non blocking.
>> Does this configuration make it non blocking?
>> 
>>   <appender name="async" class="org.apache.log4j.AsyncAppender">
>>        <param name="BufferSize" value="4096" />
>>        <param name="blocking" value="false"/>
>>    </appender>
>> 
>>    <appender name="search-indexer-async-jms"
>> class="org.apache.log4j.net.JMSAppender">
>>        <param name="InitialContextFactoryName"
>> value="org.apache.activemq.jndi.ActiveMQInitialContextFactory" />
>>        <param name="ProviderURL" value="tcp://localhost:61616"/>
>>        <param name="TopicBindingName" value="indexTopicEndpoint"/>
>>        <param name="TopicConnectionFactoryBindingName"
>> value="ConnectionFactory"/>
>> 
>>        <appender-ref ref="async" />
>>    </appender>
> 
> 
> 
> -- 
> Matt Sicker <boards@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message