As the LoggingEvent properties and the MDC properties are just a mapped set
of properties attached to a different context, how about representing them
using the same consistent form in XML. How about throwing in some other
thread specific properties? What about something like:
<properties context='thread'>
<item name='NDC'>[item value]</item>
<item name='ThreadName'>[item value]</item>
<item name='UserName'>[item value]</item>
<item name='[MDC property name]'>[item value]</item>
<item name='[MDC property name]'>[item value]</item>
</properties>
<properties context='event'>
<item name='[Event property name]'>[item value]</item>
<item name='[Event property name]'>[item value]</item>
</properties>
Just some thoughts...
------------
Nicko Cadell
> -----Original Message-----
> From: Paul Smith [mailto:[EMAIL PROTECTED]
> Sent: 19 March 2003 11:14
> To: '[EMAIL PROTECTED] '
> Subject: Adding more MDC support to several classes
>
>
> Just following up on something Mark has mentioned offline re:
> adding some more support for MDC through XMLLayout, and
> Chainsaw. I wanted to run some things by the group. Sorry if
> this is a bit long.
>
> The first thing that needs to happen is to modify the
> log4j.dtd file to incorporate the MDC structure info. I'm no
> XML expert, but here's my first guess at an example format :
>
> <log4j:MDC>
> <MDC key="MyKey1" value="MyValue2"/>
> <MDC key="MyKey2" value="MyValue2"/>
> .......
> </log4j:MDC>
>
> If anyone has any comments, speak up now! :)
>
> After we're set on the format, it'll be (as Mark said) a snap
> to modify XMLLayout to include MDC, and then I think just a
> fraction more effort to modify Chainsaw's XMLFileHandler to
> digest(!) the MDC info back from XML into something Chainsaw handles.
>
> Lastly, the PatternParser class needs to provide a format for
> outputing ALL the MDC key/value pairs if no extra %X option
> is added. Now, since the MDC is basically a Hashtable, would
> anyone object to the format of the output via the
> PatternParser being just the Hashtable.toString()?. cheers,
>
> Paul Smith
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]