[logback-dev] RFC: LoggingEvent redesign
Joern Huxhorn
jhuxhorn at googlemail.com
Wed Feb 25 16:41:10 CET 2009
Ceki Gulcu wrote:
> Joern Huxhorn wrote:
> > I disagree. I just implemented an enhanced version of the log4j NDC
> > myself as you suggested on the SLF4J mailinglist. It's implemented
> quite
> > similar to the logback MDC but isn't serialized/used by any standard
> > appender. My multiplex-appenders, on the other hand, *are* evaluating
> > it, thus adding an additional data point to the LoggingEvent.
> > Wouldn't a similar extension be possible in Ralphs case?
>
> How can multiplex-appenders access a field which does not exist in
> c.q.l.classic.spi.LoggingEvent?
They are using de.huxhorn.lilith.data.logging.LoggingEvent which
contains a field for NDC values. The conversion between
c.q.l.classic.spi.LoggingEvent and Lilith LoggingEvent is done in
/trunk/logback/logging-adapter in the
de.huxhorn.lilith.data.logging.logback.LogbackLoggingAdapter class.
That conversion is also evaluating the NDC by executing
if(!NDC.isEmpty())
{
result.setNdc(NDC.getContextStack());
}
Joern.
More information about the logback-dev
mailing list