Non blocking JMS appender

2014-04-02 Thread Mohit Anchlia
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

Re: Unit testing log4j JMS Appender

2014-04-02 Thread Mohit Anchlia
I am trying to convert my log4.properties from 1.x to log4j.xml 2.0-rc1 but I am running into this issue log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; appender class=org.apache.log4j.appender.TimeAndSizeRollingAppender name=search-indexer-async param value=false

Re: Unit testing log4j JMS Appender

2014-04-02 Thread Gary Gregory
The stack trace below shows the code trying to process an XML configuration with Log4j 1. You cannot have log4j version 1 on the classpath if you want to use version 2. The XML format between version 1 and 2 is different. Log4j 2 has a version 1 compatibility module you can use. Gary On Wed,

Re: Unit testing log4j JMS Appender

2014-04-02 Thread Mohit Anchlia
It appears that the dependency jar is trying to use log4j 1. Do you have any suggestion on how I can resolve this issue? This is my new config and error follows that: ?xml version=1.0 encoding=UTF-8? Configuration status=warn name=MyApp packages= Appenders RollingFile

Re: Unit testing log4j JMS Appender

2014-04-02 Thread Gary Gregory
I do not have time to dig deeper today, sorry. Maybe someone else will chirp in... Gary On Wed, Apr 2, 2014 at 1:40 PM, Mohit Anchlia mohitanch...@gmail.comwrote: It appears that the dependency jar is trying to use log4j 1. Do you have any suggestion on how I can resolve this issue? This is

Re: Non blocking JMS appender

2014-04-02 Thread Remko Popma
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

Re: Unit testing log4j JMS Appender

2014-04-02 Thread Mohit Anchlia
I don't think there is any problem with that jar, the issue is that I am trying to use log4j 2 but the dependency jar that I am using is using log4j 1. When I switch back to log4j 1 everything works fine. Is there a way to avoid this compatibility issue? Not sure how others that have similar issue

Re: Unit testing log4j JMS Appender

2014-04-02 Thread Remko Popma
SLF4J finds the two bindings below, but not the log4j2 binding ( *log4j-slf4j-impl-2.0.jar*). So first you need to add the log4j2 slf4j impl dependency. Second the classpath will still have the two jars below that also provide a binding. So whichever comes first in the classpath is the binding