Actually no, NDC and MDC are referenced in the layout by %x and %X i would like 
to use the conversion pattern %properties as it is explained in the javadoc of 
the EnhancedPatternLayout 
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/EnhancedPatternLayout.html
 

Setting properties in NDC or MDC can be done by using the static methods of the 
classes. But I cannot see how to define the above mentioned properties.

-----Ursprüngliche Nachricht-----
Von: Jacob Kjome [mailto:[email protected]] 
Gesendet: Freitag, 7. Mai 2010 16:12
An: Log4J Users List
Betreff: Re: Usage of EnhanedPatternLayout

I think NDC and MDC are what you are looking for.

Jake


On Fri, 7 May 2010 14:24:21 +0200
  "Huber Christian (IT-DIWA)" <[email protected]> wrote:
> Hi all,
> 
> I stumbled across the javadoc (log4j-1.2.14) for the 
>EnhancedPatternLayout and would like to use the properties conversion 
>pattern to pass additional information to the log output. Unfortunately 
>I have not found out how this can be done, I saw that a LoggingEvent 
>can be given a Map with properties during construction but usually you 
>do not instantiate a LoggingEvent but let the Logger take care of it 
>(the documentation even states that it is an internal representation so 
>I would not try to use it directly). On the other hand you cannot pass 
>any properties etc to a Logger or LoggerFactory. So I am kinda stumped here 
>what I am missing.
> 
> Could anyone give me any pointers on this?
> 
> Thanks, Chris
> 


---------------------------------------------------------------------
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]

Reply via email to