Class CompositeTriggeringPolicy
java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
org.apache.logging.log4j.core.appender.rolling.AbstractTriggeringPolicy
org.apache.logging.log4j.core.appender.rolling.CompositeTriggeringPolicy
- All Implemented Interfaces:
TriggeringPolicy
,LifeCycle
,LifeCycle2
@Plugin(name="Policies",
category="Core",
printObject=true)
public final class CompositeTriggeringPolicy
extends AbstractTriggeringPolicy
Triggering policy that wraps other triggering policies.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
-
Method Summary
Modifier and TypeMethodDescriptionstatic CompositeTriggeringPolicy
createPolicy
(TriggeringPolicy... triggeringPolicy) Creates a CompositeTriggeringPolicy.void
initialize
(RollingFileManager manager) Initializes the policy.boolean
isTriggeringEvent
(LogEvent event) Determines if a rollover should occur.boolean
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.toString()
Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, start, stop, stop
-
Method Details
-
getTriggeringPolicies
-
initialize
Initializes the policy.- Parameters:
manager
- The RollingFileManager.
-
isTriggeringEvent
Determines if a rollover should occur.- Parameters:
event
- A reference to the currently event.- Returns:
- true if a rollover should occur, false otherwise.
-
createPolicy
@PluginFactory public static CompositeTriggeringPolicy createPolicy(@PluginElement("Policies") TriggeringPolicy... triggeringPolicy) Creates a CompositeTriggeringPolicy.- Parameters:
triggeringPolicy
- The triggering policies.- Returns:
- A CompositeTriggeringPolicy.
-
stop
Description copied from interface:LifeCycle2
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.- Specified by:
stop
in interfaceLifeCycle2
- Overrides:
stop
in classAbstractLifeCycle
- Parameters:
timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argument- Returns:
- true if the receiver was stopped cleanly and normally, false otherwise.
-
toString
-