public final class FilterBasedTriggeringPolicy extends Object implements TriggeringPolicy, org.apache.log4j.spi.TriggeringEventEvaluator, org.apache.log4j.xml.UnrecognizedElementHandler
Constructor and Description |
---|
FilterBasedTriggeringPolicy()
Creates a new FilterBasedTriggeringPolicy.
|
Modifier and Type | Method and Description |
---|---|
void |
activateOptions() |
void |
addFilter(org.apache.log4j.spi.Filter newFilter)
Add a filter to end of the filter list.
|
void |
clearFilters()
Clear the filters chain.
|
org.apache.log4j.spi.Filter |
getFilter()
Returns the head Filter.
|
boolean |
isTriggeringEvent(org.apache.log4j.Appender appender,
org.apache.log4j.spi.LoggingEvent event,
String file,
long fileLength)
Determines if a rollover may be appropriate at this time.
|
boolean |
isTriggeringEvent(org.apache.log4j.spi.LoggingEvent event) |
boolean |
parseUnrecognizedElement(Element element,
Properties props) |
public FilterBasedTriggeringPolicy()
public boolean isTriggeringEvent(org.apache.log4j.spi.LoggingEvent event)
isTriggeringEvent
in interface org.apache.log4j.spi.TriggeringEventEvaluator
public boolean isTriggeringEvent(org.apache.log4j.Appender appender, org.apache.log4j.spi.LoggingEvent event, String file, long fileLength)
isTriggeringEvent
in interface TriggeringPolicy
appender
- A reference to the appender.event
- A reference to the currently event.file
- The filename for the currently active log file.fileLength
- Length of the file in bytes.public void addFilter(org.apache.log4j.spi.Filter newFilter)
newFilter
- filter to add to end of list.public void clearFilters()
public org.apache.log4j.spi.Filter getFilter()
public void activateOptions()
activateOptions
in interface org.apache.log4j.spi.OptionHandler
public boolean parseUnrecognizedElement(Element element, Properties props) throws Exception
parseUnrecognizedElement
in interface org.apache.log4j.xml.UnrecognizedElementHandler
Exception
Copyright © 2013 The Apache Software Foundation. Licensed under the Apache License, Version 2.0
Apache Extras for Apache log4j, Apache log4j and Apache are trademarks of the Apache Software Foundation.