# Class LoggerFilterLevelRange

This is a very simple filter based on level matching, which can be used to reject messages with priorities outside a certain range.

The filter admits three options LevelMin, LevelMax and AcceptOnMatch.

If the level of the `LoggerLoggingEvent` is not between Min and Max (inclusive), then `LoggerFilter::DENY` is returned.

If the Logging event level is within the specified range, then if AcceptOnMatch is true, `LoggerFilter::ACCEPT` is returned, and if AcceptOnMatch is false, `LoggerFilter::NEUTRAL` is returned.

If LevelMin is not defined, then there is no minimum acceptable level (i.e. a level is never rejected for being too "low"/unimportant). If LevelMax is not defined, then there is no maximum acceptable level (ie a level is never rejected for being too "high"/important).

Refer to the `LoggerAppender::setThreshold()` method available to all appenders extending `LoggerAppender` for a more convenient way to filter out events by level.

An example for this filter:

{@example ../../examples/php/filter_levelrange.php 19}

The corresponding XML file:

{@example ../../examples/resources/filter_levelrange.xml 18}

  LoggerConfigurable
  LoggerFilter
  LoggerFilterLevelRange

Package: log4php\filters
Author: Simon Kitching
Author: based on the org.apache.log4j.varia.LevelRangeFilte Java code by Ceki Gülcü
Version: $Revision: 1213283 $
Since: 0.6
Located at filters/LoggerFilterLevelRange.php

Methods summary
`public` | # `setAcceptOnMatch( boolean $acceptOnMatch )`

#### Parameters

$acceptOnMatch
  `boolean`
  $acceptOnMatch

`public` | # `setLevelMin( string $level )`

#### Parameters

$level
  `string`
  $l the level min to match

`public` | # `setLevelMax( string $level )`

#### Parameters

$level
  `string`
  $l the level max to match

`public integer` | # `decide( `LoggerLoggingEvent` $event )` Return the decision of this filter. Return the decision of this filter.

#### Parameters

$event
  ``LoggerLoggingEvent``
  $event

#### Returns

`integer`

#### Overrides

`LoggerFilter::decide()`

Methods inherited from LoggerFilter
`activateOptions(), addNext(), getNext()`

Methods inherited from LoggerConfigurable
`setBoolean(), setFileSize(), setInteger(), setLevel(), setNumeric(), setPositiveInteger(), setString(), warn()`

Constants inherited from LoggerFilter
`ACCEPT, DENY, NEUTRAL`

Properties summary
`protected boolean` | $acceptOnMatch | `true` | #
`protected `LoggerLevel`` | $levelMin | `` | #
`protected `LoggerLevel`` | $levelMax | `` | #

Properties inherited from LoggerFilter
`$next`