## Class LoggerFilterLevelRange

Description

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 <var>LevelMin</var>, <var>LevelMax</var> and <var>AcceptOnMatch</var>.

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 <var>AcceptOnMatch</var> is true, LoggerFilter::ACCEPT is returned, and if <var>AcceptOnMatch</var> is false, LoggerFilter::NEUTRAL is returned.

If <var>LevelMin</var> is not defined, then there is no minimum acceptable level (i.e. a level is never rejected for being too "low"/unimportant). If <var>LevelMax</var> 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:

The corresponding XML file:

- author: based on the org.apache.log4j.varia.LevelRangeFilte Java code by Ceki G&uuml;lc&uuml;
- author: Simon Kitching
- version: $Revision: 1213283 $
- since: 0.6

Located in /log4php/filters/LoggerFilterLevelRange.php (line 65)

    LoggerConfigurable
       |
       --LoggerFilter
          |
          --LoggerFilterLevelRange

Variable Summary
boolean $acceptOnMatch
LoggerLevel $levelMax
LoggerLevel $levelMin
Method Summary
integer decide (LoggerLoggingEvent $event)
void setAcceptOnMatch (boolean $acceptOnMatch)
void setLevelMax ( $level, string $l)
void setLevelMin ( $level, string $l)
Variables
boolean $acceptOnMatch = true (line 70)

- access: protected

LoggerLevel $levelMax (line 80)

- access: protected

LoggerLevel $levelMin (line 75)

- access: protected

#### Inherited Variables

Inherited from LoggerFilter

> LoggerFilter::$next

Methods
decide (line 109)

Return the decision of this filter.

- access: public

integer decide (LoggerLoggingEvent $event)

- LoggerLoggingEvent $event

Redefinition of:

LoggerFilter::decide()
  Decide what to do.

setAcceptOnMatch (line 85)

- access: public

void setAcceptOnMatch (boolean $acceptOnMatch)

- boolean $acceptOnMatch

setLevelMax (line 99)

- access: public

void setLevelMax ( $level, string $l)

- string $l: the level max to match
- $level

setLevelMin (line 92)

- access: public

void setLevelMin ( $level, string $l)

- string $l: the level min to match
- $level

#### Inherited Methods

Inherited From LoggerFilter

> LoggerFilter::activateOptions()
> LoggerFilter::addNext()
> LoggerFilter::decide()
> LoggerFilter::getNext()

Inherited From LoggerConfigurable

> LoggerConfigurable::setBoolean()
> LoggerConfigurable::setFileSize()
> LoggerConfigurable::setInteger()
> LoggerConfigurable::setLevel()
> LoggerConfigurable::setNumeric()
> LoggerConfigurable::setPositiveInteger()
> LoggerConfigurable::setString()
> LoggerConfigurable::warn()

Class Constants

#### Inherited Constants

Inherited from LoggerFilter

> LoggerFilter::ACCEPT
> LoggerFilter::DENY
> LoggerFilter::NEUTRAL

Documentation generated on Mon, 02 Feb 2026 13:59:50 +0900 by phpDocumentor 1.4.4