Package net.spy.memcached.compat.log
Class Log4JLogger
java.lang.Object
net.spy.memcached.compat.log.AbstractLogger
net.spy.memcached.compat.log.Log4JLogger
- All Implemented Interfaces:
Logger
Logging implementation using log4j.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
True if debug is enabled for this logger.boolean
True if debug is enabled for this logger.boolean
Checks whether TRACE logging is enabled.void
Wrapper around log4j.
-
Field Details
-
l4jLogger
private final org.apache.log4j.Logger l4jLogger
-
-
Constructor Details
-
Log4JLogger
Get an instance of Log4JLogger.
-
-
Method Details
-
isTraceEnabled
public boolean isTraceEnabled()Description copied from interface:Logger
Checks whether TRACE logging is enabled. This may return true, even when the logger is configured to not put the resulting output anywhere. You can use this method to avoid potential expensive (debugging) code when there is no need for it since it will be dropped anyway:if (log.isTraceEnabled()) { ... expensive code here ... log.trace(result); }
- Returns:
- true if trace messages would be displayed.
-
isDebugEnabled
public boolean isDebugEnabled()Description copied from class:AbstractLogger
True if debug is enabled for this logger. Default implementation always returns false- Specified by:
isDebugEnabled
in interfaceLogger
- Specified by:
isDebugEnabled
in classAbstractLogger
- Returns:
- true if debug messages would be displayed
-
isInfoEnabled
public boolean isInfoEnabled()Description copied from class:AbstractLogger
True if debug is enabled for this logger. Default implementation always returns false- Specified by:
isInfoEnabled
in interfaceLogger
- Specified by:
isInfoEnabled
in classAbstractLogger
- Returns:
- true if info messages would be displayed
-
log
Wrapper around log4j.- Specified by:
log
in interfaceLogger
- Specified by:
log
in classAbstractLogger
- Parameters:
level
- net.spy.compat.log.Level level.message
- object messagee
- optional throwable
-