After a heap of other projects I finally got time to solve this problem, and it was just as you stated Christian, the MQ guy gave me raw MQ details. After nagging him to set this properly up in the application server, the configuration was just this:<br>
<br>&lt;appender name=&quot;QUEUE&quot; class=&quot;com.foo.bar.common.log.CustomJMSQueueAppender&quot;&gt;<br>    &lt;QueueConnectionFactoryBindingName&gt;jms/FooBarQF&lt;/QueueConnectionFactoryBindingName&gt;<br>
    &lt;QueueBindingName&gt;jms/FooBarQ&lt;/QueueBindingName&gt;<br>
  &lt;/appender&gt;<br><br>-Espen<br><br><div class="gmail_quote">On Wed, Aug 25, 2010 at 4:56 PM, Christian Migowski <span dir="ltr">&lt;<a href="mailto:chrismfwrd@gmail.com">chrismfwrd@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Espen,<br>
<br>
this has nothing to do with logback. Your problem is that your MQ guy<br>
just gave you the &quot;raw MQ credentials&quot; (i.e. you&#39;d have to create the<br>
ConnectionFactory and Queue object by yourself), but what logback<br>
needs is a JNDI-bound ConnectionFactory and Queue.<br>
If you have an application server at hand, the most easy way to solve<br>
this is to deploy the &quot;IBM Websphere MQ resource adapter&quot; in it and<br>
use the JNDI-bound objects from there. Here is a HOWTO for Jboss:<br>
<br>
<a href="http://www.ibm.com/developerworks/websphere/library/techarticles/0710_ritchie/0710_ritchie.html" target="_blank">http://www.ibm.com/developerworks/websphere/library/techarticles/0710_ritchie/0710_ritchie.html</a><br>

<br>
hth,<br>
regards,<br>
christian!<br>
<div><div></div><div class="h5"><br>
On Wed, Aug 25, 2010 at 4:28 PM, Espen Rydningen<br>
&lt;<a href="mailto:espenrydningen@gmail.com">espenrydningen@gmail.com</a>&gt; wrote:<br>
&gt; Hi<br>
&gt;<br>
&gt; Has anyone successfully configured the JMSQueueAppender to send<br>
&gt; messages to a Websphere MQ server? I&#39;m really struggling with this.<br>
&gt; Hope someone can assist. Here is my configuration file:<br>
&gt;<br>
&gt; logback-test.xml<br>
&gt;<br>
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;<br>
&gt; &lt;configuration&gt;<br>
&gt;<br>
&gt;  &lt;appender name=&quot;STDOUT&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt;<br>
&gt;    &lt;encoder class=&quot;ch.qos.logback.classic.encoder.PatternLayoutEncoder&quot;&gt;<br>
&gt;      &lt;pattern&gt;<br>
&gt;        %d{HH:mm:ss} [%thread] %-5level %logger{0} - %msg%n<br>
&gt;      &lt;/pattern&gt;<br>
&gt;    &lt;/encoder&gt;<br>
&gt;  &lt;/appender&gt;<br>
&gt;<br>
&gt;  &lt;appender name=&quot;QUEUE&quot; class=&quot;com.foo.bar.common.log.CustomJMSQueueAppender&quot;&gt;<br>
&gt;    &lt;InitialContextFactoryName&gt;org.apache.activemq.jndi.ActiveMQInitialContextFactory&lt;/InitialContextFactoryName&gt;<br>
&gt;    &lt;ProviderURL&gt;tcp://<a href="http://10.10.10.10:1414" target="_blank">10.10.10.10:1414</a>&lt;/ProviderURL&gt;<br>
&gt;    &lt;QueueConnectionFactoryBindingName&gt;ConnectionFactory&lt;/QueueConnectionFactoryBindingName&gt;<br>
&gt;    &lt;QueueBindingName&gt;app_test_log&lt;/QueueBindingName&gt;<br>
&gt;<br>
&gt;    &lt;!-- Only messages with marker JMS gets through to queue--&gt;<br>
&gt;    &lt;filter class=&quot;com.foo.bar.common.log.MarkerFilter&quot;&gt;<br>
&gt;        &lt;marker&gt;JMS&lt;/marker&gt;<br>
&gt;        &lt;onMismatch&gt;DENY&lt;/onMismatch&gt;<br>
&gt;        &lt;onMatch&gt;ACCEPT&lt;/onMatch&gt;<br>
&gt;    &lt;/filter&gt;<br>
&gt;  &lt;/appender&gt;<br>
&gt;<br>
&gt;  &lt;root level=&quot;TRACE&quot; &gt;<br>
&gt;    &lt;appender-ref ref=&quot;STDOUT&quot; /&gt;<br>
&gt;    &lt;appender-ref ref=&quot;QUEUE&quot; /&gt;<br>
&gt;  &lt;/root&gt;<br>
&gt; &lt;/configuration&gt;<br>
&gt;<br>
&gt; My MQ guy who sat up the queue gave me these values:<br>
&gt;<br>
&gt; qmanager is ESAPFOK9<br>
&gt; machine is 10.10.10.10<br>
&gt; Channel is app.logging<br>
&gt; queue is app_test_log<br>
&gt;<br>
&gt; These are the essential parts of my Maven2 pom file:<br>
&gt;<br>
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>
&gt; (...)<br>
&gt;<br>
&gt;    &lt;dependency&gt;<br>
&gt;      &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;<br>
&gt;      &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;<br>
&gt;      &lt;version&gt;0.9.21&lt;/version&gt;<br>
&gt;    &lt;/dependency&gt;<br>
&gt;<br>
&gt;    &lt;dependency&gt;<br>
&gt;      &lt;groupId&gt;junit&lt;/groupId&gt;<br>
&gt;      &lt;artifactId&gt;junit&lt;/artifactId&gt;<br>
&gt;      &lt;version&gt;4.8.1&lt;/version&gt;<br>
&gt;      &lt;scope&gt;test&lt;/scope&gt;<br>
&gt;    &lt;/dependency&gt;<br>
&gt;<br>
&gt;    &lt;dependency&gt;<br>
&gt;                &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;<br>
&gt;                &lt;artifactId&gt;activemq-core&lt;/artifactId&gt;<br>
&gt;                &lt;version&gt;5.0.0&lt;/version&gt;<br>
&gt;                &lt;scope&gt;test&lt;/scope&gt;<br>
&gt;                &lt;exclusions&gt;<br>
&gt;                        &lt;exclusion&gt;<br>
&gt;                                &lt;groupId&gt;commons-logging&lt;/groupId&gt;<br>
&gt;                                &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;<br>
&gt;                        &lt;/exclusion&gt;<br>
&gt;                        &lt;exclusion&gt;<br>
&gt;                                &lt;groupId&gt;commons-logging&lt;/groupId&gt;<br>
&gt;                                &lt;artifactId&gt;commons-logging-api&lt;/artifactId&gt;<br>
&gt;                        &lt;/exclusion&gt;<br>
&gt;                        &lt;exclusion&gt;<br>
&gt;                &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;<br>
&gt;                &lt;artifactId&gt;activeio-core&lt;/artifactId&gt;<br>
&gt;            &lt;/exclusion&gt;<br>
&gt;        &lt;/exclusions&gt;<br>
&gt;    &lt;/dependency&gt;<br>
&gt;<br>
&gt;  &lt;/dependencies&gt;<br>
&gt;<br>
&gt; &lt;/project&gt;<br>
&gt;<br>
&gt; I made a really simple Junit test:<br>
&gt;<br>
&gt; public class CustomJMSQueueAppenderTest {<br>
&gt;    private final static Logger logger =<br>
&gt; LoggerFactory.getLogger(CustomJMSQueueAppenderTest.class);<br>
&gt;    private static Marker JMS_LOG = MarkerFactory.getMarker(&quot;JMS_LOG&quot;);<br>
&gt;<br>
&gt;    @Test<br>
&gt;    public void sendLogMessageToMqAndFile(){<br>
&gt;        <a href="http://logger.info" target="_blank">logger.info</a>(&quot;New test run: {}&quot;, new Date());<br>
&gt;        <a href="http://logger.info" target="_blank">logger.info</a>(&quot;This message will only be sent to console&quot;);<br>
&gt;        <a href="http://logger.info" target="_blank">logger.info</a>(JMS_LOG, &quot;This message is to be sent both to<br>
&gt; console and to JMS&quot;);<br>
&gt;    }<br>
&gt; }<br>
&gt;<br>
&gt; But alas, this was the result:<br>
&gt;<br>
&gt; Running com.foo.bar.common.log.CustomJMSQueueAppenderTest<br>
&gt; 15:50:41,860 |-INFO in ch.qos.logback.classic.LoggerContext[default] -<br>
&gt; Found resource [logback-test.xml] at<br>
&gt; [file:/usr/IBM/build/frontend-trunk/delegator/foobar/target/test-classes/logback-test.xml]<br>
&gt; 15:50:42,329 |-INFO in<br>
&gt; ch.qos.logback.classic.joran.action.ConfigurationAction - debug<br>
&gt; attribute not set<br>
&gt; 15:50:42,411 |-INFO in ch.qos.logback.core.joran.action.AppenderAction<br>
&gt; - About to instantiate appender of type<br>
&gt; [ch.qos.logback.core.ConsoleAppender]<br>
&gt; 15:50:42,431 |-INFO in ch.qos.logback.core.joran.action.AppenderAction<br>
&gt; - Naming appender as [STDOUT]<br>
&gt; 15:50:42,593 |-INFO in<br>
&gt; ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Pushing<br>
&gt; component [encoder] on top of the object stack.<br>
&gt; 15:50:42,872 |-INFO in<br>
&gt; ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Pushing<br>
&gt; component [filter] on top of the object stack.<br>
&gt; 15:50:42,961 |-INFO in ch.qos.logback.core.joran.action.AppenderAction<br>
&gt; - About to instantiate appender of type<br>
&gt; [com.foo.bar.common.log.CustomJMSQueueAppender]<br>
&gt; 15:50:42,981 |-INFO in ch.qos.logback.core.joran.action.AppenderAction<br>
&gt; - Naming appender as [QUEUE]<br>
&gt; 15:50:43,070 |-INFO in<br>
&gt; ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Pushing<br>
&gt; component [filter] on top of the object stack.<br>
&gt; 15:50:47,121 |-ERROR in<br>
&gt; com.foo.bar.common.log.CustomJMSQueueAppender[QUEUE] - Error while<br>
&gt; activating options for appender named [QUEUE]. javax.jms.JMSException:<br>
&gt; java.io.EOFException<br>
&gt;        at javax.jms.JMSException: java.io.EOFException<br>
&gt;        at      at<br>
&gt; org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)<br>
&gt;        at      at<br>
&gt; org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1178)<br>
&gt;        at      at<br>
&gt; org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1262)<br>
&gt;        at      at<br>
&gt; org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:292)<br>
&gt;        at      at<br>
&gt; org.apache.activemq.ActiveMQConnection.createQueueSession(ActiveMQConnection.java:1123)<br>
&gt;        at      at<br>
&gt; ch.qos.logback.classic.net.JMSQueueAppender.start(JMSQueueAppender.java:113)<br>
&gt;        at      at<br>
&gt; ch.qos.logback.core.joran.action.AppenderAction.end(AppenderAction.java:96)<br>
&gt;        at      at<br>
&gt; ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:315)<br>
&gt;        at      at<br>
&gt; ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:194)<br>
&gt;        at      at<br>
&gt; ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:180)<br>
&gt;        at      at<br>
&gt; ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:52)<br>
&gt;        at      at<br>
&gt; ch.qos.logback.core.joran.spi.Interpreter.play(Interpreter.java:332)<br>
&gt;        at      at<br>
&gt; ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:126)<br>
&gt;        at      at<br>
&gt; ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:93)<br>
&gt;        at      at<br>
&gt; ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:52)<br>
&gt;        at      at<br>
&gt; ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:60)<br>
&gt;        at      at<br>
&gt; ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:121)<br>
&gt;        at      at<br>
&gt; org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)<br>
&gt;        at      at<br>
&gt; org.slf4j.impl.StaticLoggerBinder.&lt;clinit&gt;(StaticLoggerBinder.java:55)<br>
&gt;        at      at java.lang.J9VMInternals.initializeImpl(Native Method)<br>
&gt;        at      at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)<br>
&gt;        at      at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)<br>
&gt;        at      at<br>
&gt; org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)<br>
&gt;        at      at<br>
&gt; org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)<br>
&gt;        at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)<br>
&gt;        at      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254)<br>
&gt;        at      at<br>
&gt; com.foo.bar.common.log.CustomJMSQueueAppenderTest.&lt;clinit&gt;(CustomJMSQueueAppenderTest.java:13)<br>
&gt;        at      at java.lang.J9VMInternals.initializeImpl(Native Method)<br>
&gt;        at      at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)<br>
&gt;        at      at<br>
&gt; sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)<br>
&gt;        at      at<br>
&gt; sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)<br>
&gt;        at      at<br>
&gt; sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)<br>
&gt;        at      at<br>
&gt; java.lang.reflect.Constructor.newInstance(Constructor.java:522)<br>
&gt;        at      at<br>
&gt; org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:202)<br>
&gt;        at      at<br>
&gt; org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:251)<br>
&gt;        at      at<br>
&gt; org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)<br>
&gt;        at      at<br>
&gt; org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:248)<br>
&gt;        at      at<br>
&gt; org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)<br>
&gt;        at      at<br>
&gt; org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)<br>
&gt;        at      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)<br>
&gt;        at      at<br>
&gt; org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)<br>
&gt;        at      at<br>
&gt; org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)<br>
&gt;        at      at<br>
&gt; org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)<br>
&gt;        at      at<br>
&gt; org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)<br>
&gt;        at      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)<br>
&gt;        at      at<br>
&gt; org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)<br>
&gt;        at      at<br>
&gt; org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)<br>
&gt;        at      at<br>
&gt; org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)<br>
&gt;        at      at org.apache.maven.surefire.Surefire.run(Surefire.java:177)<br>
&gt;        at      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
&gt;        at      at<br>
&gt; sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)<br>
&gt;        at      at<br>
&gt; sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
&gt;        at      at java.lang.reflect.Method.invoke(Method.java:618)<br>
&gt;        at      at<br>
&gt; org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)<br>
&gt;        at      at<br>
&gt; org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)<br>
&gt; Caused by: java.io.EOFException<br>
&gt;        at      at java.io.DataInputStream.readFully(DataInputStream.java:204)<br>
&gt;        at      at java.io.DataInputStream.readInt(DataInputStream.java:380)<br>
&gt;        at      at<br>
&gt; org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:268)<br>
&gt;        at      at<br>
&gt; org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:192)<br>
&gt;        at      at<br>
&gt; org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:184)<br>
&gt;        at      at<br>
&gt; org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:172)<br>
&gt;        at      at java.lang.Thread.run(Thread.java:810)<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Now I&#39;m very lost. Hoping someone can help me out.<br>
&gt;<br>
&gt; Best regards<br>
&gt; Espen<br>
</div></div>&gt; _______________________________________________<br>
&gt; Logback-user mailing list<br>
&gt; <a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
&gt; <a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
&gt;<br>
_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
<a href="http://qos.ch/mailman/listinfo/logback-user" target="_blank">http://qos.ch/mailman/listinfo/logback-user</a><br>
</blockquote></div><br>