org.apache.log4j.rolling
Class FilterBasedTriggeringPolicy
java.lang.Object
|
+--org.apache.log4j.rolling.FilterBasedTriggeringPolicy
- All Implemented Interfaces:
- OptionHandler, TriggeringPolicy
- public final class FilterBasedTriggeringPolicy
- extends Object
- implements TriggeringPolicy
FilterBasedTriggeringPolicy determines if rolling should be triggered
by evaluating the current message against a set of filters. Unless a
filter rejects a message, a rolling event will be triggered.
- Since:
- 1.3
- Author:
- Curt Arnold
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FilterBasedTriggeringPolicy
public FilterBasedTriggeringPolicy()
- Creates a new FilterBasedTriggeringPolicy.
isTriggeringEvent
public boolean isTriggeringEvent(Appender appender,
LoggingEvent event,
String file,
long fileLength)
- {@inheritDoc}
- Specified by:
isTriggeringEvent
in interface TriggeringPolicy
- Following copied from interface:
org.apache.log4j.rolling.TriggeringPolicy
- Parameters:
appender
- A reference to the appender.event
- A reference to the currently event.filename
- The filename for the currently active log file.fileLength
- Length of the file in bytes.- Returns:
- true if a rollover should occur.
addFilter
public void addFilter(Filter newFilter)
- Add a filter to end of the filter list.
- Parameters:
newFilter
- filter to add to end of list.
clearFilters
public void clearFilters()
- Clear the filters chain.
getFilter
public Filter getFilter()
- Returns the head Filter.
- Returns:
- head of filter chain, may be null.
activateOptions
public void activateOptions()
- {@inheritDoc}
- Specified by:
activateOptions
in interface OptionHandler
Copyright © 2000-2006 Apache Software Foundation.
Licensed under the Apache License, Version 2.0.