Praveen, I think sifting appender can only use one key from the MDC in the file name.
It would be nice to use more, but that would require changes in logback. In fact I've wanted to do this before. But made a work around with two sifting appender and a filter. David On 30 May 2013, at 10:28, praveen patil <[email protected]> wrote: > Hi everyone > > I am setting two variable in MDC and then in my appender in file tag i gave > two variable ${configId} and ${threadName}. but when i run it i get only > threadName value and for ${configId} it shows configId is UNDEFIND. but when > the mdc context i found it is in the context, then why it giving error. > > <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender"> > <discriminator > class="com.hotwaxmedia.logger.ThreadNameBasedDiscriminator"/> > <sift> > <appender class="ch.qos.logback.core.FileAppender"> > > <file>runtime/logs/DataManagerLog/${configId}-${threadName}.html</file> > <layout class="ch.qos.logback.classic.PatternLayout"> > <pattern><div class="%p">%d > \(${threadName} -%X{configId}\) [%logger{0} : %-5level] > %msg%n%rEx</div></pattern> > </layout> > </appender> > </sift> > </appender> > > please help. > > Praveen > _______________________________________________ > Logback-user mailing list > [email protected] > http://mailman.qos.ch/mailman/listinfo/logback-user _______________________________________________ Logback-user mailing list [email protected] http://mailman.qos.ch/mailman/listinfo/logback-user
