org.apache.log.filter

Class PriorityFilter

Implemented Interfaces:
FilterTarget, LogTarget

public class PriorityFilter
extends AbstractFilterTarget

Filters log events based on priority.
Author:
Peter Donald

Constructor Summary

PriorityFilter(Priority priority)
Constructor that sets the priority that is filtered against.

Method Summary

protected boolean
filter(LogEvent event)
Filter the log event based on priority.
void
setPriority(Priority priority)
Set priority used to filter.

Methods inherited from class org.apache.log.filter.AbstractFilterTarget

addTarget, filter, processEvent

Constructor Details

PriorityFilter

public PriorityFilter(Priority priority)
Constructor that sets the priority that is filtered against.
Parameters:
priority - the Priority

Method Details

filter

protected boolean filter(LogEvent event)
Filter the log event based on priority. If LogEvent has a Lower or Equal priroity then discard it.
Overrides:
filter in interface AbstractFilterTarget
Parameters:
event - the event
Returns:
return true to discard event, false otherwise

setPriority

public void setPriority(Priority priority)
Set priority used to filter.
Parameters:
priority - the priority to filter on