Filters |
AndFilter Overview |
You use AndFilter when you want to log messages that meet multiple criteria. AndFilter syntax allows for two or more subfilter definitions within the AndFilter definition. The subfilters are evaluated to decide whether to accept or deny the log event. AndFilters performs a logical AND operation, using the results of each subfilter evaluation to determine the results of AndFilter.
An example of using AndFilter might be that you want to filter log messages that have a threshold of INFO and that contain the string "New client connection".
You can filter by a single threshold, a range of thresholds, or by string matching.
AndFilter Syntax |
<filter class="AndFilter">
|
</filter> |
AndFilter Syntax Description |
specifies to apply the AND logical operation on the subfilter results to determine whether the log event is accepted by the appender.
for AndFilter, specifies whether to accept or deny the log event if the result of the logical AND is TRUE. For subfilter definitions, specifies whether to accept or deny the log event if the threshold or string matches. Valid values are TRUE or FALSE.
TRUE |
specifies to accept the log event. |
FALSE |
for AndFilter, StringMatchFilter, and LevelMatchFilter, specifies to deny the log event. |
specifies the name of a filter to use as an argument to the AND logical operation. Here is a list of valid filters:
AndFilter
LevelMatchFilter
LevelRangeFilter
StringMatchFilter
specifies the name of a filter parameter and the parameter value that is used to compare with either the log event threshold or the message. The following table shows the filter parameters:
AndFilter Examples |
The following filter accepts log events that have a threshold of INFO and the string RETURN in the following log message:
<filter class="AndFilter"> <param name="AcceptOnMatch" value="true"/> <filter class="LevelMatchFilter"> <param name="LevelToMatch" value="info"/> <param name="AcceptOnMatch" value="true"/> </filter> <filter class="StringMatchFilter"> <param name="StringToMatch" value="RETURN"/> <param name="AcceptOnMatch" value="true"/> </filter> </filter>
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.