Hello Dirk
Thank you very much. That is exacly what I need.
Best Regards
Joerg
OOMS DIRK wrote:
You could map the 3 strings onto MDC key-value pairs, e.g. (m1, "string1) and address them in a PatternLayout by %X{m1}, etc.
Hope this is what you were looking for.
dirk
Dear All
Is it possible to log for example a object with 3 strings and refer it later in PatternLayout with e.g %m1 %m2 %m3 ?
Below there is some dummy code.
Thanks in advance for any hint.
Best Regards
Joerg
Example dummy code:
---------------------- class MESSAGE{
public String a; public String b; public String c;
public message (String a, String b, String c) { this.a = a; this.b = b; this.c = c; }
} -----------------
somewhere in the program
....
MESSAGE message new MESSAGE ("hello", "log", "reader");
....
logger.getLogger(CategoryName).log(WRAPPER_FQN, Level.INFO, message,null);
....
----------------
in the log4j.xml
<appender ...>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern"
value="%m1 %m2 %m3)" />
</layout>
....
---------------- As output from the appender hello log reader
--------------------------------------------------------------------- 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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
