9 May 2011 23:55
LikeRule in Apache Extras Companion (used by ExpressionFilter)
Dasgupta, Ranjan <Ranjan_Dasgupta <at> dell.com>
2011-05-09 21:55:56 GMT
2011-05-09 21:55:56 GMT
In the LikeRule evaluate(...) method, the matcher uses the matcher.matches(...) which checks for the
whole string to match to. Shouldn't it be using the matcher.find(), so that we do not log if a part of the log
string matched the pattern provided? Or is there any other way of doing that?
I am trying not to log messages that match \\b\\d{13,16}\\b
<filter class="org.apache.log4j.filter.ExpressionFilter">
<param name="Expression" value="MSG LIKE \\b\\d{13,16}\\b"/>
<param name="AcceptOnMatch" value="false"/>
</filter>
Thanks,
Ranjan Dasgupta
RSS Feed