Overview

Packages

  • log4php
    • appenders
    • configurators
    • filters
    • helpers
    • layouts
    • pattern
    • renderers

Classes

  • LoggerFilterDenyAll
  • LoggerFilterLevelMatch
  • LoggerFilterLevelRange
  • LoggerFilterStringMatch
  • Overview
  • Package
  • Class
  • Tree

Class LoggerFilterLevelMatch

This is a very simple filter based on level matching.

The filter admits two options LevelToMatch and AcceptOnMatch. If there is an exact match between the value of the LevelToMatch option and the level of the LoggerLoggingEvent, then the LoggerFilterLevelMatch::decide() method returns LoggerFilter::ACCEPT in case the AcceptOnMatch option value is set to true, if it is false then LoggerFilter::DENY is returned. If there is no match, LoggerFilter::NEUTRAL is returned.

An example for this filter:

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

The corresponding XML file:

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

LoggerConfigurable
Extended by LoggerFilter
Extended by LoggerFilterLevelMatch
Package: log4php\filters
Version: $Revision: 1213283 $
Since: 0.6
Located at filters/LoggerFilterLevelMatch.php
Methods summary
public
# setAcceptOnMatch( boolean $acceptOnMatch )

Parameters

$acceptOnMatch
boolean
$acceptOnMatch
public
# setLevelToMatch( string $level )

Parameters

$level
string
$l the level to match
public integer
# decide( LoggerLoggingEvent $event )

Return the decision of this filter.

Return the decision of this filter.

Returns LoggerFilter::NEUTRAL if the LevelToMatch option is not set or if there is not match. Otherwise, if there is a match, then the returned decision is LoggerFilter::ACCEPT if the AcceptOnMatch property is set to true. The returned decision is LoggerFilter::DENY if the AcceptOnMatch property is set to false.

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
#

Indicates if this event should be accepted or denied on match

Indicates if this event should be accepted or denied on match

protected LoggerLevel $levelToMatch
#

The level, when to match

The level, when to match

Properties inherited from LoggerFilter
$next
Apache log4php API documentation generated by ApiGen 2.8.0