[slf4j-dev] MDC Type functionality
Ceki Gülcü
listid at qos.ch
Mon Mar 26 20:55:16 CEST 2007
At 03:40 PM 3/26/2007, Gardiner, Paul wrote:
>I have written an SLF4J binding to the Equinox extended log service, which
>is an extension of the OSGi logging service, that includes contextual
>information, and passes isLoggable statements through to log listeners
>(readers). The problem I have is supporting extra data that is not part
>of the log message. SLF4J does not include MDC or NDC functionality, so I
>am not sure of the best way to pass through this kind of data. A typical
>use case is session id, which is passed as MDC. When the log entry is
>made, the session id is included in the file appender, but omitted from an
>appender that sends pages. One solution is to read all MDC data and pass
>it through to the OSGi log service, and then recreate it in the log
>reader. However, I was wondering if there was a more elegant/less
>expensive solution.
As for a more elegant solution, end-user code could use the more advanced
features of such and such logging system *directly*. However, I guess that
is not an option for a general purpose library such as equinox.
>Thanks,
>Paul
--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
More information about the slf4j-dev
mailing list