Use RepeatMatchFilter to discard a message if the message has already been logged by the appender.


<filter class="RepeatMatchFilter">
<param name="AcceptOnMatch" value="TRUE | FALSE"/>

Syntax Description

name="AcceptOnMatch" value="TRUE | FALSE"
specifies whether to accept or deny the log event when the log event message is identical to the last message processed by the appender. Valid values are TRUE or FALSE:
specifies to accept the log event.
specifies to deny the log event.


This filter compares only the last message processed by this appender with the current log event message.
As a best practice, you can use this filter as the first filter in appender filtering policies to discard repeated messages.


The following filter definition does not accept log events if a log event message has already been logged by this appender:
<filter class="RepeatMatchFilter">
   <param name="AcceptOnMatch" value="FALSE"/>