You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This filter returns the {@code onMatch} result if the level in the {@code LogEvent} is in the range of the configured
33
-
* min and max levels, otherwise it returns {@code onMismatch} value . For example, if the filter is configured with
34
-
* {@link Level#ERROR} and {@link Level#INFO} and the LogEvent contains {@link Level#WARN} then the onMatch value will
35
-
* be returned since {@link Level#WARN WARN} events are in between {@link Level#ERROR ERROR} and {@link Level#INFO
36
-
* INFO}.
32
+
* This filter returns the {@link #onMatch} result if the level of the {@link LogEvent} is in the range of the configured {@link #minLevel} and {@link #maxLevel} values, otherwise it returns the {@link #onMismatch} result.
33
+
* The default values for {@link #minLevel} and {@link #maxLevel} are set to {@link Level#OFF} and {@link Level#ALL}, respectively.
34
+
* The default values for {@link #onMatch} and {@link #onMismatch} are set to {@link Result#NEUTRAL} and {@link Result#DENY}, respectively.
37
35
* <p>
38
-
* The default Levels are both {@link Level#ERROR ERROR}.
36
+
* The levels get compared by their associated integral values; {@link Level#OFF} has an integral value of 0, {@link Level#FATAL} 100, {@link Level#ERROR} 200, and so on.
37
+
* For example, if the filter is configured with {@link #maxLevel} set to {@link Level#INFO}, the filter will return {@link #onMismatch} result for {@link LogEvent}s of level with higher integral values; {@link Level#DEBUG}, {@link Level#TRACE}, etc.
Copy file name to clipboardExpand all lines: src/site/xdoc/manual/filters.xml
+54Lines changed: 54 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -235,6 +235,60 @@
235
235
</Loggers>
236
236
</Configuration>]]></pre>
237
237
</subsection>
238
+
239
+
<aname="LevelRangeFilter"/>
240
+
<subsectionname="LevelRangeFilter">
241
+
<p>
242
+
<code>LevelRangeFilter</code> allows filtering against a level range, where levels get compared by their associated integral values; <code>OFF</code> has an integral value of 0, <code>FATAL</code> 100, <code>ERROR</code> 200, and so on.
<td>the minimum level threshold (defaults to <code>OFF</code>, which has an integral value of 0)</td>
255
+
</tr>
256
+
<tr>
257
+
<td><code>maxLevel</code></td>
258
+
<td><code>Level</code></td>
259
+
<td>the maximum level threshold (defaults to <code>ALL</code>, which has an integral value of <code>Integer.MAX_VALUE</code>)</td>
260
+
</tr>
261
+
<tr>
262
+
<td><code>onMatch</code></td>
263
+
<td><code>Filter.Result</code></td>
264
+
<td>the result to return on a match, where allowed values are <code>ACCEPT</code>, <code>DENY</code> or <code>NEUTRAL</code> (default)</td>
265
+
</tr>
266
+
<tr>
267
+
<td><code>onMismatch</code></td>
268
+
<td><code>Filter.Result</code></td>
269
+
<td>the result to return on a mismatch, where allowed values are <code>ACCEPT</code>, <code>DENY</code> (default) or <code>NEUTRAL</code></td>
270
+
</tr>
271
+
</table>
272
+
<p>
273
+
In the following example configuration, a <code>LevelRangeFilter</code> is configured with <code>maxLevel</code> set to <code>INFO</code>.
274
+
The filter will return <code>onMismatch</code> result (i.e., <code>DENY</code>, the default) for log events of level with higher integral values than <code>INFO</code>; i.e., <code>DEBUG</code>, <code>TRACE</code>, etc.
0 commit comments