<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Oh wow, I actually haven't noticed that I just have FileAppender, not RollingFileAppender</span></div><div><span>The 'home' property is defined higher up, so that part works well now</span></div><div>Thank you for the hint about debug, going to save a lot of frustration<br><span></span></div><div><br><span></span></div><div><span>Could you advise on how to use <if> with mdc values? What I'm trying is the following:</span></div><div><br><span></span></div><div><span>I have this in my SiftingAppender:</span></div><div><span class="tab">    </span><span class="tab">    </span><span><discriminator><br>            <key>variable</key><br>           
 <defaultValue>default</defaultValue> <br>        </discriminator></span></div><div><br></div><div>I want to determine the file name depending on the property, such that (inside rollingPolicy):</div><div><br></div><div><span class="tab">    </span><span class="tab">    </span><span class="tab">    </span><span class="tab">    </span><if condition='property("variable").equals("default")'><br>                    <then><br>                        <fileNamePattern>${home}/logs/generic-logs.%d{yyyy-MM}.%i.log</fileNamePattern> <br>                    </then><br>   
                 <else><br>                        <fileNamePattern>${home}/logs/${variable}.%d{yyyy-MM-dd}.%d{HHmm,aux}.%i.log</fileNamePattern><br>                    </else><br>                </if><br></div><div><br></div><div>At the moment the .equals check seems to fail all the time, and so the 1st fileNamePattern is never used. What am I doing wrong?<br><span></span></div><div><br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span
 style="font-weight:bold;">From:</span></b> ceki <ceki@qos.ch><br> <b><span style="font-weight: bold;">To:</span></b> logback users list <logback-user@qos.ch> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, June 14, 2012 1:02:19 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [logback-user] Split logs to different files by MDC?<br> </font> </div> <br>By the way, since the home property is used within SiftingAppender, it<br>should be defined in the "context" scope. Example:<br><br>   <property name="home" value="/tmp" scope="context"/><br><br>HTH,<br>-- <br>Ceki<br><a href="http://twitter.com/#%21/ceki" target="_blank">http://twitter.com/#!/ceki</a><br><br>On 14.06.2012 18:57, ceki wrote:<br>> Hi Yura,<br>><br>> There multiple errors in the config you provided (independent of<br>> SiftingAppender). As a general recommendation, you should set the<br>> debug attribute to true to
 see the errors.<br>><br>> <configuration debug="true"><br>> ...<br>> </configuration?<br>><br>> Here are a few hints.<br>><br>> Hint1: ch.qos.logback.core.rolling.RollingFileAppender not FileAppender<br>> Hint2: SizeAndTimeBasedFNATPExt does not exist<br>><br>> HTH,<br>_______________________________________________<br>Logback-user mailing list<br><a ymailto="mailto:Logback-user@qos.ch" href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br><a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br><br><br> </div> </div>  </div></body></html>