Dear all
I have one question about NDC element and Filter rules. Is it possible to make a StringFilter for a NDC value ?
Example: Following filter rule for a file appender <filter class="org.apache.log4j.varia.StringMatchFilter"> <param name="StringToMatch" value="1234"/> <param name="AcceptOnMatch" value="true"/> </filter>
And NDC.push ("User:" +1234);
Does log4j write only the statements in the log file with this String.
The StringMatchFilter only acts on the message string not the NDC or MDC. You can write your own filter which is quite easy to do. Otherwise, have a look at the log4j-sandbox:
http://cvs.apache.org/viewcvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/filter/
May be it is stupid question but I tried and it was not working correct. Unfortunately I have not so much information about NDC functionality and XML rules. The manual book needs long time to deliver ;-(
Lehmanns books (www.lob.de) probably ran out of stock. In any case, a new shipment is on its way.
Joerg
-- Ceki For log4j documentation consider "The complete log4j manual" ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
In the USA the log4j manual is carried by Softpro books.
http://store.yahoo.com/softpro/2-9700369-0-8.html
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
