Package org.apache.ignite.internal.util
Class GridLogThrottle
- java.lang.Object
-
- org.apache.ignite.internal.util.GridLogThrottle
-
- Direct Known Subclasses:
LT
public class GridLogThrottle extends Object
Grid log throttle.Errors are logged only if they were not logged for the last
throttleTimeoutmilliseconds. Note that not only error messages are checked for duplicates, but also exception classes.
-
-
Field Summary
Fields Modifier and Type Field Description static intDFLT_LOG_THROTTLE_CAPACITYstatic intDFLT_THROTTLE_TIMEOUTDefault throttle timeout in milliseconds (value is 5 * 60 * 1000).
-
Constructor Summary
Constructors Modifier Constructor Description protectedGridLogThrottle()Ensure singleton.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclear()Clears all stored data.static voiderror(@Nullable IgniteLogger log, @Nullable Throwable e, String msg)Logs error if needed.static voiderror(@Nullable IgniteLogger log, @Nullable Throwable e, String msg, boolean byMsg)Logs error if needed.static voidinfo(@Nullable IgniteLogger log, String msg)Logs info if needed.static voidinfo(@Nullable IgniteLogger log, String msg, boolean quiet)Logs info if needed.static intthrottleCapacity()Gets system-wide log throttle capacity.static intthrottleTimeout()Gets system-wide log throttle timeout.static voidthrottleTimeout(int timeout)Sets system-wide log throttle timeout.static voidwarn(@Nullable IgniteLogger log, @Nullable Throwable e, String msg, boolean quite, boolean byMsg)Logs warning if needed.static voidwarn(@Nullable IgniteLogger log, String msg)Logs warning if needed.static voidwarn(@Nullable IgniteLogger log, String msg, boolean quiet)Logs warning if needed.static voidwarn(@Nullable IgniteLogger log, String msg, Throwable e)Logs warning if needed.
-
-
-
Field Detail
-
DFLT_THROTTLE_TIMEOUT
public static final int DFLT_THROTTLE_TIMEOUT
Default throttle timeout in milliseconds (value is 5 * 60 * 1000).- See Also:
- Constant Field Values
-
DFLT_LOG_THROTTLE_CAPACITY
public static final int DFLT_LOG_THROTTLE_CAPACITY
-
-
Method Detail
-
throttleTimeout
public static void throttleTimeout(int timeout)
Sets system-wide log throttle timeout.- Parameters:
timeout- System-wide log throttle timeout.
-
throttleTimeout
public static int throttleTimeout()
Gets system-wide log throttle timeout.- Returns:
- System-side log throttle timeout.
-
throttleCapacity
public static int throttleCapacity()
Gets system-wide log throttle capacity.- Returns:
- System-side log throttle capacity.
-
error
public static void error(@Nullable @Nullable IgniteLogger log, @Nullable @Nullable Throwable e, String msg)Logs error if needed.- Parameters:
log- Logger.e- Error (optional).msg- Message.
-
error
public static void error(@Nullable @Nullable IgniteLogger log, @Nullable @Nullable Throwable e, String msg, boolean byMsg)Logs error if needed.- Parameters:
log- Logger.e- Error (optional).msg- Message.byMsg- Errors group by message, not by tuple(error, msg).
-
warn
public static void warn(@Nullable @Nullable IgniteLogger log, String msg)Logs warning if needed.- Parameters:
log- Logger.msg- Message.
-
warn
public static void warn(@Nullable @Nullable IgniteLogger log, @Nullable @Nullable Throwable e, String msg, boolean quite, boolean byMsg)Logs warning if needed.- Parameters:
log- Logger.e- Error (optional).msg- Message.quite- Print warning anyway.byMsg- Errors group by message, not by tuple(error, msg).
-
warn
public static void warn(@Nullable @Nullable IgniteLogger log, String msg, boolean quiet)Logs warning if needed.- Parameters:
log- Logger.msg- Message.quiet- Print warning anyway.
-
warn
public static void warn(@Nullable @Nullable IgniteLogger log, String msg, Throwable e)Logs warning if needed.- Parameters:
log- Logger.msg- Message.e- Error..
-
info
public static void info(@Nullable @Nullable IgniteLogger log, String msg, boolean quiet)Logs info if needed.- Parameters:
log- Logger.msg- Message.quiet- Print info anyway.
-
info
public static void info(@Nullable @Nullable IgniteLogger log, String msg)Logs info if needed.- Parameters:
log- Logger.msg- Message.
-
clear
public static void clear()
Clears all stored data. This will make throttle to behave like a new one.
-
-