<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.6036" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=068025809-23112010>I am using the 
SiftingAppender to isolate log events with a specific MDC key. This works really 
well, giving me high signal:noise ratio log files for specific invocations 
on&nbsp;particular process etc etc.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=068025809-23112010></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=068025809-23112010>However the 
SiftingAppender (or rather the MDCBasedDiscriminator) insists on the provision 
of a 'default value'. If I supply this default value (e.g. "unknown") then all 
unmatched events will be directed to unknown.log. But the 'other' log events are 
already logged separately so the entries in 'unknown.log' are unwanted 
duplicates (for me). </SPAN><SPAN class=068025809-23112010>I</SPAN><SPAN 
class=068025809-23112010>deally&nbsp;I would use the sifting appender for a 
particular use case and let everything else be logged the way it is currently 
logged i.e. I would lke to provide no default value and have the appender 
understand this to mean 'ignore any events which do not match the given key' but 
that seems not to be supported so I'm trying to figure out how to either discard 
the unwanted events or to incorporate my existing logging into the sifting 
appender.&nbsp;</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN 
class=068025809-23112010></SPAN></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=068025809-23112010>I'd be 
grateful if someone could suggest how I might do either of the 
following:</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN 
class=068025809-23112010></SPAN></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN 
class=068025809-23112010></SPAN></FONT></FONT><FONT face=Arial size=2><SPAN 
class=068025809-23112010>&nbsp;* somehow discard the 'unknown' events 
discriminated by the SiftingAppender i.e. to ignore them completely as they are 
already logged elsewhere</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=068025809-23112010>or 
</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=068025809-23112010>&nbsp;* figure out 
how to control the 'unknown' log events so that Ii can direct them to&nbsp;an 
'everything else' appender which is distinct from the 'isolated events' 
appender</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=068025809-23112010></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=068025809-23112010>I've included an 
example of the config below. The STDOUT appender is the main appender, there's a 
wrapper process running the java app and this wrapper process redirects STDOUT 
to its own log file (with its own rolling rules etc) therefore the 'everything 
else' events are all logged to STDOUT. I'd like&nbsp;the SIFTER to only log 
events for which it gets a match otherwise we end up with the same events 
in&nbsp;STDOUT and in "unknown.log". Alternatively, if there is a way to 
configure SIFTER such that it wraps the STDOUT appender and the unmatched events 
are only directed to that appender then that would work too. I have tried 
several configurations but I cannot associate the unmatched events with a 
specific appender.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=068025809-23112010></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=068025809-23112010>&lt;configuration&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;appender name="STDOUT" 
class="ch.qos.logback.core.ConsoleAppender"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;encoder&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;pattern&gt;[%-5p] [%t] %logger{5}: 
%m%n&lt;/pattern&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/encoder&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/appender&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;appender name="SIFTER" 
class="ch.qos.logback.classic.sift.SiftingAppender"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;discriminator&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;Key&gt;isolatedLogName&lt;/Key&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;defaultValue&gt;unknown&lt;/defaultValue&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/discriminator&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;sift&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;appender name="${isolatedLogName}" 
class="ch.qos.logback.core.FileAppender"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;File&gt;${log.path:-target/log}/${isolatedLogName}.log&lt;/File&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;encoder&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;Pattern&gt;%d | %-5p | %logger{5} | 
%m%n&lt;/Pattern&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/encoder&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/appender&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/sift&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/appender&gt;</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=068025809-23112010>&nbsp;&nbsp;&nbsp; 
&lt;!--&nbsp; ... loggers excluded for brevity ... --&gt;</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=068025809-23112010>&nbsp;&nbsp;&nbsp; 
&lt;root level="INFO"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;appender-ref ref="STDOUT" 
/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;appender-ref 
ref="SIFTER"/&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;/root&gt;<BR>&lt;/configuration&gt;</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=068025809-23112010></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=068025809-23112010>For example: I tried 
this:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=068025809-23112010></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=068025809-23112010>&nbsp;&nbsp;&nbsp; 
&lt;appender name="SIFTER" 
class="ch.qos.logback.classic.sift.SiftingAppender"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;discriminator&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;Key&gt;isolatedLogName&lt;/Key&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;defaultValue&gt;everythingElse&lt;/defaultValue&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/discriminator&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;sift&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;appender name="isolatedLogName" 
class="ch.qos.logback.core.FileAppender"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;File&gt;${log.path:-target/log}/${isolatedLogName}.log&lt;/File&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;encoder&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;Pattern&gt;%d | %-5p | %logger{5} | 
%m%n&lt;/Pattern&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/encoder&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/appender&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;appender name="everythingElse" 
class="ch.qos.logback.core.ConsoleAppender"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;encoder&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;pattern&gt;[%-5p] [%t] %logger{5}: 
%m%n&lt;/pattern&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/encoder&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/appender&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;/sift&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/appender&gt;</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=068025809-23112010></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=068025809-23112010>And logback created 
two files - everythingElse.log and &lt;the real value associated with the 
isolatedLogName key&gt;.log - then wrote all output to the "everythingElse" 
appender. I was trying to tell it to do this: "if the key's value is the default 
value then ignore it or if that is not possible then direct the output to the 
appender named after that value otherwise direct to the other 
appender".</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=068025809-23112010></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=068025809-23112010>Any help 
appreciated, thanks.</SPAN></FONT></DIV><pre>
***********************************************************************************
The Royal Bank of Scotland plc. Registered in Scotland No 90312. 
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorised and regulated by the Financial Services Authority. The
Royal Bank of Scotland N.V. is authorised and regulated by the 
De Nederlandsche Bank and has its seat at Amsterdam, the 
Netherlands, and is registered in the Commercial Register under 
number 33002587. Registered Office: Gustav Mahlerlaan 10, 
Amsterdam, The Netherlands. The Royal Bank of Scotland N.V. and 
The Royal Bank of Scotland plc are authorised to act as agent for each 
other in certain jurisdictions.
 
This e-mail message is confidential and for use by the addressee only.
If the message is received by anyone other than the addressee, please 
return the message to the sender by replying to it and then delete the 
message from your computer. Internet e-mails are not necessarily 
secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland 
N.V. including its affiliates ("RBS group") does not accept responsibility 
for changes made to this message after it was sent. 

Whilst all reasonable care has been taken to avoid the transmission of 
viruses, it is the responsibility of the recipient to ensure that the onward
transmission, opening or use of this message and any attachments will 
not adversely affect its systems or data. No responsibility is accepted 
by the RBS group in this regard and the recipient should carry out such 
virus and other checks as it considers appropriate. 

Visit our website at www.rbs.com

***********************************************************************************
</pre></BODY></HTML>