Class BurstFilter.Builder
java.lang.Object
org.apache.logging.log4j.core.filter.AbstractFilter.AbstractFilterBuilder<BurstFilter.Builder>
org.apache.logging.log4j.core.filter.BurstFilter.Builder
- All Implemented Interfaces:
Builder<BurstFilter>
- Enclosing class:
- BurstFilter
public static class BurstFilter.Builder
extends AbstractFilter.AbstractFilterBuilder<BurstFilter.Builder>
implements Builder<BurstFilter>
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.filter.AbstractFilter.AbstractFilterBuilder
ATTR_ON_MATCH, ATTR_ON_MISMATCH
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the object after all configuration has been set.Sets the logging level to use.setMaxBurst
(long maxBurst) Sets the maximum number of events that can occur before events are filtered for exceeding the average rate.setRate
(float rate) Sets the average number of events per second to allow.Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilter.AbstractFilterBuilder
asBuilder, getOnMatch, getOnMismatch, setOnMatch, setOnMismatch
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.logging.log4j.core.util.Builder
getErrorPrefix, isValid
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setLevel
Sets the logging level to use.- Parameters:
level
- the logging level to use.- Returns:
- this
-
setRate
Sets the average number of events per second to allow.- Parameters:
rate
- the average number of events per second to allow. This must be a positive number.- Returns:
- this
-
setMaxBurst
Sets the maximum number of events that can occur before events are filtered for exceeding the average rate.- Parameters:
maxBurst
- Sets the maximum number of events that can occur before events are filtered for exceeding the average rate. The default is 10 times the rate.- Returns:
- this
-
build
Description copied from interface:Builder
Builds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.- Specified by:
build
in interfaceBuilder<BurstFilter>
- Returns:
- the configured instance.
-