<div dir="ltr">That should be easy. Juast add import correct classes and then do at proper section (posiblt the init of the thread) MDC.put(key, value).</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 9, 2013 at 10:35 AM, KwonNam Son <span dir="ltr"><<a href="mailto:kwon37xi@gmail.com" target="_blank">kwon37xi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>
        <p>Hello,<br></p><p>When I use Log4j, I can add MDC properties to <a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/spi/LoggingEvent.html" rel="nofollow" target="_blank">LogginEvent</a> by using <a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/rewrite/RewriteAppender.html" rel="nofollow" target="_blank">RewriteAppender</a>.
It's possible because log4j's LoggingEvent is not an interface and it has <a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/spi/LoggingEvent.html#setProperty%28java.lang.String,%20java.lang.String%29" rel="nofollow" target="_blank">setProperty()</a> method.</p>



<p>Is it possible to add or modify MDC properties dynamically in Logback?</p>

<p>The reason I need to change MDC properties using appenders is because
 of some logs from unaccessible threads.
I want to add hostname, application name and some of server's infomation
 to the logs then transfer the logs event to the central log receiver.</p><p><br></p><p>Thanks.<br></p><br></div></div>
<br>_______________________________________________<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><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Felipe
</div>