<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Great, SiftingAppender </span>seems to be what I need, once I can configure it correctly</div><div><br></div><div>Could you assist with rolling policy for it? I have a rolling policy that rolls over on size. Whether I put it in the sifting appender <br></div><div>(<b><span class="tag"><appender</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"SIFT"</span><span class="pln"> </span><span class="atn">class</span><span class="pun">=</span><span class="atv">"ch.qos.logback.classic.sift.SiftingAppender"</span><span class="tag">>) </span></b><span class="tag"><br></span></div><div><span class="tag">or one of the generated ones</span><b><span class="tag"> <br></span></b></div><div><b><span class="tag">(</span></b><span class="pln"><b><span
class="tag"><appender</span><span class="pln"> </span><span class="atn">name</span><span class="pun">=</span><span class="atv">"FILE-</span><span class="green"><span class="atv">${userid}</span></span><span class="atv">"</span><span class="pln"> </span><span class="atn">class</span><span class="pun">=</span><span class="atv">"ch.qos.logback.core.FileAppender"</span><span class="tag">>)</span></b><span class="pln"></span></span></div><div><span class="pln"><span class="pln">it seems to have no effect in either case. The rolling policy works fine in a separate FileAppender. Is it possible to add a rolling policy for a sifting appender, am I missing something?</span></span></div><div><span class="pln"><span class="pln"><br></span></span></div><div><span class="pln"><span class="pln">Thank you.<br></span></span></div><div><br></div><div><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> Tuesday, June 12, 2012 4:00:28 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><br>I'd suggest to re-write the expression as<br><br> ((String))mdc.get("variable").matches("/test/")<br><br>Are you familiar with SiftingAppender? It seems to address a use case <br>similar to yours.<br>HTH,<br><br>[1] <a href="http://logback.qos.ch/manual/appenders.html#SiftingAppender" target="_blank">http://logback.qos.ch/manual/appenders.html#SiftingAppender</a><br><br>--
<br>Ceki<br><a href="http://twitter.com/#%21/ceki" target="_blank">http://twitter.com/#!/ceki</a><br><br><br>On 12.06.2012 20:17, Yura Levandovskyy wrote:<br>> Hello<br>><br>> I have an application that has an mdc variable. How can I make a proper<br>> filter, so that if variable = test, all such output goes to one file,<br>> and to another file if variable is anything else?<br>><br>> I tried the following (not sure how to go from there even if it worked<br>> though):<br>><br>> <expression><br>> mdc?.get("variable") ~= /test/<br>> </expression><br>><br>> but the result is<br>><br>> ERROR in ch.qos.logback.classic.boolex.JaninoEventEvaluator@7d55b9f -<br>> Could not start evaluator with expression [mdc?.get("variable") ~= /test/ )]<br>><br>> Any suggestions?<br>><br>> Thanks<br>><br><br><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>