[logback-user] Can we have more then one varable in file name

praveen patil iampraveenpatil at gmail.com
Thu May 30 10:28:34 CEST 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20130530/5c3b2558/attachment.html>


More information about the Logback-user mailing list