Package org.opends.server.loggers
Class LogAggregator
- java.lang.Object
-
- org.opends.server.loggers.LogAggregator
-
public class LogAggregator extends Object
A simple aggregator to prevent a burst of regularly repeated messages from flooding the logs. Messages known to be generated for an event occurring very frequently, for every protocol message or periodically, can be logged at first occurrence and then only at increasing intervals.
-
-
Constructor Summary
Constructors Constructor Description LogAggregator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
log(Consumer<LocalizableMessage> logMethod, LocalizableMessage message)
Log a message and start the aggregation for it.void
logAndPurge()
Log message bursts and purge expired messages.
-
-
-
Method Detail
-
log
public void log(Consumer<LocalizableMessage> logMethod, LocalizableMessage message)
Log a message and start the aggregation for it.The message will be logged right away and if repeated, at fixed intervals. In case of burst (more than 20 times in a second), there will be a warning about it.
- Parameters:
logMethod
- how to log the messagemessage
- the message
-
logAndPurge
public void logAndPurge()
Log message bursts and purge expired messages.
-
-