<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On 28 March 2013 16:17, MychaL <span dir="ltr"><<a href="mailto:mychal.13@gmail.com" target="_blank">mychal.13@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Because we have to create a new log dynamically and with MDC discriminator.<br></blockquote><div><br></div><div style>That's where I was confused. That is what the standard sifting appender config file setup is for: dynamically creating logs based on MDC keys. So, unless you were using some other discrimination (or something very fancy in terms of when files were created or something), why would you programmatically create a sifting appender? (Even in the former case, you would still configure the sifting appender in the config file, just provide your own discrimination class.)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I made some search on AppenderFactory but dunno how to use it....<br>
<br>
We have all, except the link between SiftingAppender and FileAppender :(<br>
<br>
How is framework working to read configuration ? Is it not possible to have a method to set the parent appender ?<br></blockquote><div><br></div><div style>The factory design pattern is pretty common in such situations (create some context-specific class dynamically), and I assume that the framework definitely uses it internally. You seem to be doubting that the framework 'really' works like this. (?) Unfortunately, I don't have time to look at coding a simple factory template. Maybe someone else can help?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thank you.<br>
<br>Le 28 mars 2013 à 14:18, Stuart Rossiter <<a href="mailto:stuart.p.rossiter@gmail.com">stuart.p.rossiter@gmail.com</a>> a écrit :<br>
<br>
> M. MychaL <mychal.13@...> writes:<br><br>
>><br>
>> Plz, need help on this subject....Is it possible to attach the fileappender to<br>
>> the siftingappender exactly as in XML configuration ?Thank you.<br>
><br>
> Without having done this, I presume that you need to set up an AppenderFactory<br>
> (via setAppenderFactory), since that is what will dynamically create the<br>
> appenders.<br>
><br>
> It might be useful if you said why you were trying to do this though. If you're<br>
> just using MDC discrimination, why not do it in the config file?<br>
><br>
> Stuart<br><br></blockquote><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
_______________________________________________<br>
Logback-user mailing list<br>
<a 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></blockquote></div><br><br clear="all"><div><br></div>-- <br>________________________________<div>
Stuart Rossiter</div><div><a href="mailto:stuart.p.rossiter@gmail.com" target="_blank">stuart.p.rossiter@gmail.com</a></div><div><br></div><div><div>Research Fellow: EPSRC Care Life Cycle Project</div><div><a href="http://www.southampton.ac.uk/clc" target="_blank">http://www.southampton.ac.uk/clc</a></div>
</div><div><br></div>
</div></div>