Sorry for the double post, gmail pulled a trick on me :) Just ignore the other post.<br><br>Hi<br><br>I want to revisit this subject and theme. <a href="http://marc.info/?l=logback-user&m=121130259107132&w=2">I saw that this thread ended 20th May 2008</a>, but I did not find any conclusions on your discussion. The reason I find this subject interesting, is that I have use case which I can't seem to solve in any other way then setting a turbofilter on an appender.<br>
<br>This is situation:<br>One enterprise web application, which today uses a proprietary, home built, logging framework, logs statement to both file and to a database via an EJB. I have started the work to replace this logging framework with LogBack/SL4J.<br>
<br>Our new design would include file appender, and a jms appender which posts to a jms queue.<br><br>Example of log statements in the current solution:<br><codeSnippet> <br> //The logger is the file logger<br>
logger.debug("Bar property was not defined in abc.properties");<br><br> //FooLog is responsible for sending log message to the EJB<br> LogContext lctx = new LogContext("webapplication", getClass().getName(),
"theFooBarMethod()", LayerType.PRESENTATION);<br> FooLog.log(logcontext, 6001, new String[] { "Bar property was not defined in abc.properties" }, null);<br></codeSnippet><br><br>
This type of logging I want to change to this kind of logging:<br><codeSnippet><br> logger.debug("Bar property was
not defined in abc.properties");<br></codeSnippet><br>
<br>This is my use case:<br>We need to separate which log statements that goes to file and which goes to JMS (and eventually to database) <br><br>This is how I want to solve it:<br><br>This would only go to file<br><codeSnippet><br>
logger.debug("Bar property was not defined in abc.properties");<br></codeSnippet><br><br>But this would go to both file and jms<br><codeSnippet><br> Marker JMS_MARKER = MarkerFactory.getMarker("JMS");<br>
logger.debug(JMS_MARKER, "Bar property was not defined in abc.properties");<br></codeSnippet><br><br>This could be obtained by doing something like this:<br><br><appender name="Queue" class="com.a.b.c.log.CustomJMSQueueAppender"><br>
<InitialContextFactoryName>org.apache.activemq.jndi.ActiveMQInitialContextFactory</InitialContextFactoryName><br> <ProviderURL>tcp://localhost:61616</ProviderURL><br> <QueueConnectionFactoryBindingName>ConnectionFactory</QueueConnectionFactoryBindingName><br>
<QueueBindingName>MyQueue</QueueBindingName><br> <br> <turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter"><br> <Marker>JMS</Marker><br> <OnMismatch>DENY</OnMismatch><br>
</turboFilter><br> <br> </appender><br><br>To end this; Is my use case covered in LogBack framework somehow, without waiting for this kind of features?<br>