<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>logback.xml SIFT Appenders</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=6376248" />
  <subtitle>logback.xml SIFT Appenders</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=6376248</id>
  <updated>2013-05-22T23:15:57Z</updated>
  <dc:date>2013-05-22T23:15:57Z</dc:date>
  <entry>
    <title>RE: logback.xml SIFT Appenders</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6433296" />
    <author>
      <name>Binny Mathew</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6433296</id>
    <updated>2012-09-06T13:31:43Z</updated>
    <published>2012-09-06T13:31:43Z</published>
    <summary type="html">The issue was resolved. 

I wrote a custom class for the filter which would decide to write the log or not. Below is the snippet

 &lt;appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender"&gt;
    &lt;discriminator&gt;
      &lt;key&gt;icm_call_id&lt;/key&gt;
      &lt;defaultValue&gt;unkown&lt;/defaultValue&gt;
    &lt;/discriminator&gt;
    &lt;sift&gt;
      &lt;appender name="FILE-${icm_call_id}" class="ch.qos.logback.core.FileAppender"&gt;
        &lt;filter class="com.citi.global.util.LogbackFilter"/&gt;
        &lt;file&gt;c:/tmp/DWHConfig/logs/hu/${icm_call_id}.log&lt;/file&gt;
        &lt;append&gt;false&lt;/append&gt;
        &lt;layout class="ch.qos.logback.classic.PatternLayout"&gt;
          &lt;pattern&gt;%d [%thread] %level %mdc %logger{35} - %msg%n&lt;/pattern&gt;
        &lt;/layout&gt;
      &lt;/appender&gt;
    &lt;/sift&gt;
&lt;/appender&gt;

Thanks
Binny</summary>
    <dc:creator>Binny Mathew</dc:creator>
    <dc:date>2012-09-06T13:31:43Z</dc:date>
  </entry>
  <entry>
    <title>logback.xml SIFT Appenders</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6376247" />
    <author>
      <name>Binny Mathew</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6376247</id>
    <updated>2012-08-29T06:51:43Z</updated>
    <published>2012-08-29T06:47:38Z</published>
    <summary type="html">I am working with logback.xml and below is the snippet that i am using so as every call will have a log based on the icm-call-id.
Initially when the Application loads the icm-call-id will not be there so the an "unknown.log" gets created (defaultValue). 

&lt;!--Working fine --&gt;
&lt;appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender"&gt;
    &lt;discriminator&gt;
       &lt;key&gt;icm_call_id&lt;/key&gt;
       &lt;defaultValue&gt;unkown&lt;/defaultValue&gt;
    &lt;/discriminator&gt;
    &lt;sift&gt;
&lt;appender name="FILE-${icm_call_id}" class="ch.qos.logback.core.FileAppender"&gt;
      &lt;file&gt;c:/tmp/DWHConfig/logs/hu/${icm_call_id}.log&lt;/file&gt;
         &lt;append&gt;false&lt;/append&gt;
      &lt;layout class="ch.qos.logback.classic.PatternLayout"&gt;
         &lt;pattern&gt;%d [%thread] %level %mdc %logger{35} - %msg%n&lt;/pattern&gt;
      &lt;/layout&gt;
 &lt;/appender&gt;
 &lt;/sift&gt;
 &lt;/appender&gt;
[b][/b]
[b]The issue is whenever i try to implement the filter parameter the log (nor the icm-call-id or the unknown.log) gets written[/b]
[b][/b]
&lt;filter class="ch.qos.logback.core.filter.EvaluatorFilter"&gt;
         &lt;!-- GEventEvaluator requires Groovy --&gt;
         &lt;evaluator class="ch.qos.logback.classic.boolex.GEventEvaluator"&gt;
           &lt;expression&gt;
               (mdc.get("icm_call_id") == null)
           &lt;/expression&gt;
         &lt;/evaluator&gt;
         &lt;OnMismatch&gt;NEUTRAL&lt;/OnMismatch&gt;
         &lt;OnMatch&gt;DENY&lt;/OnMatch&gt;
&lt;/filter&gt;

What am i missing here?? When i try to implement the [b]timeBasedPolicy only on the unknown.log that too does not work.[/b] 
 
Binny</summary>
    <dc:creator>Binny Mathew</dc:creator>
    <dc:date>2012-08-29T06:47:38Z</dc:date>
  </entry>
</feed>

