logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bender Heri" <HBen...@Ergonomics.ch>
Subject AW: Log4j : Read String from file
Date Mon, 22 Jun 2009 11:42:24 GMT
If "fixed string" means the string stays the same throughout the lifetime of the running application
you can use the MDC. You add your string into the MDC at startup and reference its key within
the layout pattern ("X{<key>}").
Heri

-----Urspr√ľngliche Nachricht-----
Von: durbans [mailto:m34890721@yahoo.it] 
Gesendet: Montag, 22. Juni 2009 12:24
An: log4j-user@logging.apache.org
Betreff: Log4j : Read String from file


Now I am logging this kind of string

2009-06-19 15:31:17,636 DEBUG 

with this ConversionPattern 

<layout class="org.apache.log4j.PatternLayout">

</layout>

I'd like to insert a String like this

2009-06-19 15:31:17,636 XXXXYYMM_HHMMSS DEBUG 

where XXXXYYMM_HHMMSS is a fixed string read from a file. 
Is it possibile to do it ? How ?
--
View this message in context: http://www.nabble.com/Log4j-%3A-Read-String-from-file-tp24144879p24144879.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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