Overview

Packages

  • Log
    • Filters
    • Formatters
    • Handlers

Classes

  • Horde_Log_Filter_Constraint
  • Horde_Log_Filter_ExactLevel
  • Horde_Log_Filter_Level
  • Horde_Log_Filter_Message
  • Horde_Log_Filter_Suppress

Interfaces

  • Horde_Log_Filter
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Log_Filter_Constraint

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

Horde_Log_Filter_Constraint implements Horde_Log_Filter
Package: Log\Filters
Category: Horde
License: BSD
Author: James Pepin james@jamespepin.com
Located at Horde/Log/Filter/Constraint.php
Methods summary
public
# __construct( Horde_Constraint_Coupler $coupler = null )

Constructor

Constructor

Parameters

$coupler
<p>The default kind of constraint to use to couple multiple constraints. Defaults to And.</p>
public Horde_Log_Filter_Constraint
# addConstraint( string $field, Horde_Constraint $constraint )

Add a constraint to the filter

Add a constraint to the filter

Parameters

$field
<p>The field to apply the constraint to.</p>
$constraint
The constraint to apply.

Returns

Horde_Log_Filter_Constraint

A reference to $this to allow method chaining.

public Horde_Log_Filter_Constraint
# addRegex( string $field, string $regex )

Add a regular expression to filter by

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

$field
<p>The name of the field that should be part of the event.</p>
$regex
The regular expression to filter by.

Returns

Horde_Log_Filter_Constraint

A reference to $this to allow method chaining.

public Horde_Log_Filter_Constraint
# addRequiredField( string $field )

Add a required field to the filter

Add a required field to the filter

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

Parameters

$field
<p>The name of the field that should be part of the event.</p>

Returns

Horde_Log_Filter_Constraint

A reference to $this to allow method chaining.

public Horde_Log_Filter_Constraint
# addRequiredFields( )

Adds all arguments passed as required fields

Adds all arguments passed as required fields

Returns

Horde_Log_Filter_Constraint

A reference to $this to allow method chaining.

public boolean
# accept( array $event )

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

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

Parameters

$event
Log event.

Returns

boolean
accepted?

Implementation of

Horde_Log_Filter::accept()
Constants inherited from Horde_Log_Filter
ACCEPT, IGNORE
API documentation generated by ApiGen