logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Huber Christian (IT-DIWA)" <Christian.Hu...@swisslife.de>
Subject AW: Usage of EnhanedPatternLayout
Date Mon, 10 May 2010 09:02:56 GMT
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:hoju@visi.com] 
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)" <Christian.Huber@swisslife.de> 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: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message