\Horde_Log_Filter_Constraint

Filters log events using defined constraints on one or more fields of the $event array.

Summary

Methods
Properties
Constants
__construct()
addConstraint()
addRegex()
addRequiredField()
addRequiredFields()
accept()
No public properties found
No constants found
No protected methods found
$_constraints
$_coupler
N/A
No private methods found
No private properties found
N/A

Properties

$_constraints

$_constraints : array

Constraint list.

Type

array

$_coupler

$_coupler : \Horde_Constraint_Coupler

Default constraint coupler.

Type

\Horde_Constraint_Coupler

Methods

__construct()

__construct(\Horde_Constraint_Coupler  $coupler = null) 

Constructor

Parameters

\Horde_Constraint_Coupler $coupler

The default kind of constraint to use to couple multiple constraints. Defaults to And.

addConstraint()

addConstraint(string  $field, \Horde_Constraint  $constraint) : \Horde_Log_Filter_Constraint

Add a constraint to the filter

Parameters

string $field

The field to apply the constraint to.

\Horde_Constraint $constraint

The constraint to apply.

Returns

\Horde_Log_Filter_Constraint

A reference to $this to allow method chaining.

addRegex()

addRegex(string  $field, string  $regex) : \Horde_Log_Filter_Constraint

Add a regular expression to filter by

Takes a field name and a regex, if the regex does not match then the event is filtered.

Parameters

string $field

The name of the field that should be part of the event.

string $regex

The regular expression to filter by.

Returns

\Horde_Log_Filter_Constraint

A reference to $this to allow method chaining.

addRequiredField()

addRequiredField(string  $field) : \Horde_Log_Filter_Constraint

Add a required field to the filter

If the field does not exist on the event, then it is filtered.

Parameters

string $field

The name of the field that should be part of the event.

Returns

\Horde_Log_Filter_Constraint

A reference to $this to allow method chaining.

addRequiredFields()

addRequiredFields() : \Horde_Log_Filter_Constraint

Adds all arguments passed as required fields

Returns

\Horde_Log_Filter_Constraint

A reference to $this to allow method chaining.

accept()

accept(array  $event) : boolean

Returns Horde_Log_Filter::ACCEPT to accept the message, Horde_Log_Filter::IGNORE to ignore it.

Parameters

array $event

Log event.

Returns

boolean —

accepted?