<div dir="ltr"><div class="">
        <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">LogginEvent</a> by using <a href="http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/rewrite/RewriteAppender.html" rel="nofollow">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">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>