Class AwaitUnconditionallyReliabilityStrategy
- java.lang.Object
-
- org.apache.logging.log4j.core.config.AwaitUnconditionallyReliabilityStrategy
-
- All Implemented Interfaces:
LocationAwareReliabilityStrategy,ReliabilityStrategy
public class AwaitUnconditionallyReliabilityStrategy extends java.lang.Object implements ReliabilityStrategy, LocationAwareReliabilityStrategy
Reliability strategy that sleeps unconditionally for some time before allowing a Configuration to be stopped.
-
-
Field Summary
Fields Modifier and Type Field Description private static longDEFAULT_SLEEP_MILLISprivate LoggerConfigloggerConfigprivate static longSLEEP_MILLIS
-
Constructor Summary
Constructors Constructor Description AwaitUnconditionallyReliabilityStrategy(LoggerConfig loggerConfig)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterLogEvent()Called after a log event was logged.voidbeforeStopAppenders()Called before all appenders are stopped.voidbeforeStopConfiguration(Configuration configuration)Called before the configuration is stopped.LoggerConfiggetActiveLoggerConfig(Supplier<LoggerConfig> next)For internal use by the ReliabilityStrategy; returns the LoggerConfig to use.voidlog(Supplier<LoggerConfig> reconfigured, java.lang.String loggerName, java.lang.String fqcn, java.lang.StackTraceElement location, Marker marker, Level level, Message data, java.lang.Throwable t)Logs an event.voidlog(Supplier<LoggerConfig> reconfigured, java.lang.String loggerName, java.lang.String fqcn, Marker marker, Level level, Message data, java.lang.Throwable t)Logs an event.voidlog(Supplier<LoggerConfig> reconfigured, LogEvent event)Logs an event.private static longsleepMillis()
-
-
-
Field Detail
-
DEFAULT_SLEEP_MILLIS
private static final long DEFAULT_SLEEP_MILLIS
- See Also:
- Constant Field Values
-
SLEEP_MILLIS
private static final long SLEEP_MILLIS
-
loggerConfig
private final LoggerConfig loggerConfig
-
-
Constructor Detail
-
AwaitUnconditionallyReliabilityStrategy
public AwaitUnconditionallyReliabilityStrategy(LoggerConfig loggerConfig)
-
-
Method Detail
-
sleepMillis
private static long sleepMillis()
-
log
public void log(Supplier<LoggerConfig> reconfigured, java.lang.String loggerName, java.lang.String fqcn, Marker marker, Level level, Message data, java.lang.Throwable t)
Description copied from interface:ReliabilityStrategyLogs an event.- Specified by:
login interfaceReliabilityStrategy- Parameters:
reconfigured- supplies the next LoggerConfig if the strategy's LoggerConfig is no longer activeloggerName- The name of the Logger.fqcn- The fully qualified class name of the caller.marker- A Marker or null if none is present.level- The event Level.data- The Message.t- A Throwable or null.
-
log
public void log(Supplier<LoggerConfig> reconfigured, java.lang.String loggerName, java.lang.String fqcn, java.lang.StackTraceElement location, Marker marker, Level level, Message data, java.lang.Throwable t)
Description copied from interface:LocationAwareReliabilityStrategyLogs an event.- Specified by:
login interfaceLocationAwareReliabilityStrategy- Parameters:
reconfigured- supplies the next LoggerConfig if the strategy's LoggerConfig is no longer activeloggerName- The name of the Logger.fqcn- The fully qualified class name of the caller.location- The location of the caller or null.marker- A Marker or null if none is present.level- The event Level.data- The Message.t- A Throwable or null.
-
log
public void log(Supplier<LoggerConfig> reconfigured, LogEvent event)
Description copied from interface:ReliabilityStrategyLogs an event.- Specified by:
login interfaceReliabilityStrategy- Parameters:
reconfigured- supplies the next LoggerConfig if the strategy's LoggerConfig is no longer activeevent- The log event.
-
getActiveLoggerConfig
public LoggerConfig getActiveLoggerConfig(Supplier<LoggerConfig> next)
Description copied from interface:ReliabilityStrategyFor internal use by the ReliabilityStrategy; returns the LoggerConfig to use.- Specified by:
getActiveLoggerConfigin interfaceReliabilityStrategy- Parameters:
next- supplies the next LoggerConfig if the strategy's LoggerConfig is no longer active- Returns:
- the currently active LoggerConfig
-
afterLogEvent
public void afterLogEvent()
Description copied from interface:ReliabilityStrategyCalled after a log event was logged.- Specified by:
afterLogEventin interfaceReliabilityStrategy
-
beforeStopAppenders
public void beforeStopAppenders()
Description copied from interface:ReliabilityStrategyCalled before all appenders are stopped.- Specified by:
beforeStopAppendersin interfaceReliabilityStrategy
-
beforeStopConfiguration
public void beforeStopConfiguration(Configuration configuration)
Description copied from interface:ReliabilityStrategyCalled before the configuration is stopped.- Specified by:
beforeStopConfigurationin interfaceReliabilityStrategy- Parameters:
configuration- the configuration that will be stopped
-
-