Hi,<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You could easyly write your own discriminator class combining<br>
JNDIBasedContextDiscriminator and MDCBasedDiscriminator. Here is an example:<br>
<br>
public class CombinedDiscriminator extends ContextAwareBase implements<br>
Discriminator<ILoggingEvent> {<br>
<br>
private String defaultMDCVal = "default";<br>
<br>
public String getDiscriminatingValue(ILoggingEvent event) {<br>
String mdcValue = defaultMDCVal;<br>
Map<String, String> mdcMap = event.getMdc();<br>
if (mdcMap != null) {<br>
mdcValue = mdcMap.get(key);<br>
}<br>
String contextName = event.getLoggerContextVO().getName();<br>
return contextName + mdcValue;<br>
}<br>
..etc<br>
}<br>
<br></blockquote><br>Thanks for reply, i started to implement, but i noticed that maybe i don't explain well, i dont need "sumValue = contextName + mdcValue" value to use in <FileNamePattern>${newValue}.log</FileNamePattern><br>
<br>That i really need is two values... contextName and mdcValue...<br><br>The aprox, maybe something like <FileNamePattern>${newValue.substring(0,x)}/${newValue.substring(x,n)}.log</FileNamePattern><br><br>or something like<br>
<br><appender ... class="ch.qos.logback.classic.sift.SiftingAppender"><br> <discriminator class="ch.qos.logback.classic.sift.JNDIBasedContextDiscriminator"><br> ...<br> <sift><br>
<appender ... class="ch.qos.logback.classic.sift.SiftingAppender"><br> <discriminator><br> ...<br> <sift><br> <appender class="ch.qos.logback.core.rolling.RollingFileAppender"><br>
</div><br>SiftingAppender inside SiftingAppender to use MDC and contextName.<br><br>Any suggestion?<br><br>And thanks again.<br clear="all"><br>-- <br>Jose Juan Montiel Martinez<br>Eurobits Technologies<br>Calle Musgo 3, 1ยช Planta<br>
28023 Madrid<br>T +34-917080300<br>F +34-913077480<br><a href="mailto:josejuan.montiel@eurobits.es">josejuan.montiel@eurobits.es</a><br><a href="http://www.eurobits.com">http://www.eurobits.com</a><br>