Filter log by matching pattern - log4j
问题 I have the following layout patter in my log4j xml file: "%d{ISO8601} %c %p [%t] [%x] 9.5.4.RC12 %m%n" What I want is that when ever I get a log containing message process [proc#] completed , it should be skipped. I mean every log except the one containing this message should be printed. [proc#] will contain the process number of max lenght 4. What can I desing a filter with this function in my xml config file. If so, then how? 回答1: ExpressionFilter can do that. In a filter definition inside