[logback-user] (no subject)

KwonNam Son kwon37xi at gmail.com
Tue Jul 9 16:35:10 CEST 2013


Hello,

When I use Log4j, I can add MDC properties to
LogginEvent<http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/spi/LoggingEvent.html>by
using
RewriteAppender<http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/rewrite/RewriteAppender.html>.
It's possible because log4j's LoggingEvent is not an interface and it has
setProperty()<http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/spi/LoggingEvent.html#setProperty%28java.lang.String,%20java.lang.String%29>method.

Is it possible to add or modify MDC properties dynamically in Logback?

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.


Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20130709/d738b0a7/attachment.html>


More information about the Logback-user mailing list