|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.logging.log4j.core.filter.AbstractFilter
org.apache.logging.log4j.core.filter.BurstFilter
public final class BurstFilter
The BurstFilter
is a logging filter that regulates logging
traffic. Use this filter when you want to control the maximum burst of log
statements that can be sent to an appender. The filter is configured in the
log4j configuration file. For example, the following configuration limits the
number of INFO level (as well as DEBUG and TRACE) log statements that can be sent to the
console to a burst of 100 with an average rate of 16 per second. WARN, ERROR and FATAL messages would continue to
be delivered.
<Console name="console">
<PatternLayout pattern="%-5p %d{dd-MMM-yyyy HH:mm:ss} %x %t %m%n"/>
<filters>
<Burst level="INFO" rate="16" maxBurst="100"/>
</filters>
</Console>
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.Filter |
---|
Filter.Result |
Field Summary |
---|
Fields inherited from class org.apache.logging.log4j.core.filter.AbstractFilter |
---|
LOGGER, onMatch, onMismatch |
Method Summary | |
---|---|
void |
clear()
Clear the history. |
static BurstFilter |
createFilter(String levelName,
String rate,
String maxBurst,
String match,
String mismatch)
|
Filter.Result |
filter(LogEvent event)
Context Filter method. |
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
org.apache.logging.log4j.message.Message msg,
Throwable t)
Appender Filter method. |
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
Object msg,
Throwable t)
Appender Filter method. |
Filter.Result |
filter(Logger logger,
org.apache.logging.log4j.Level level,
org.apache.logging.log4j.Marker marker,
String msg,
Object[] params)
Appender Filter method. |
int |
getAvailable()
Returns the number of available slots. |
String |
toString()
|
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilter |
---|
getOnMatch, getOnMismatch, isStarted, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object[] params)
AbstractFilter
filter
in interface Filter
filter
in class AbstractFilter
logger
- the Logger.level
- The logging Level.marker
- The Marker, if any.msg
- The message, if present.params
- An array of parameters or null.
public Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, Object msg, Throwable t)
AbstractFilter
filter
in interface Filter
filter
in class AbstractFilter
logger
- the Logger.level
- The logging Level.marker
- The Marker, if any.msg
- The message, if present.t
- A throwable or null.
public Filter.Result filter(Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, org.apache.logging.log4j.message.Message msg, Throwable t)
AbstractFilter
filter
in interface Filter
filter
in class AbstractFilter
logger
- the Logger.level
- The logging Level.marker
- The Marker, if any.msg
- The message, if present.t
- A throwable or null.
public Filter.Result filter(LogEvent event)
AbstractFilter
filter
in interface Filter
filter
in class AbstractFilter
event
- The LogEvent.
public int getAvailable()
public void clear()
public String toString()
toString
in class AbstractFilter
public static BurstFilter createFilter(String levelName, String rate, String maxBurst, String match, String mismatch)
levelName
- The logging level.rate
- The average number of events per second to allow.maxBurst
- The maximum number of events that can occur before events are filtered for exceeding the
average rate. The default is 10 times the rate.match
- The Result to return when the filter matches. Defaults to Result.NEUTRAL.mismatch
- The Result to return when the filter does not match. The default is Result.DENY.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |