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 <[email protected]> wrote: > > It would be in log4j2! As far as I know, that is. > > >> On 2 April 2014 12:00, Mohit Anchlia <[email protected]> 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 <[email protected]> --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
