Class Log4JLoggerWrapper
- java.lang.Object
-
- lumis.util.log.Log4JLoggerWrapper
-
- All Implemented Interfaces:
ILogger
public class Log4JLoggerWrapper extends Object implements ILogger
An implementation ofILogger
that delegates the calls to the log4j library.This class also configures the log4j library to use the configuration file at
<configPath>/lumislogconfig.xml
.- Since:
- 4.0.0
- Version:
- $Revision: 19212 $ $Date: 2016-07-15 17:56:23 -0300 (Fri, 15 Jul 2016) $
- See Also:
ILogger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface lumis.util.log.ILogger
ILogger.Level
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.log4j.Logger
log4jLogger
The log4j logger instance that is being wrapped.
-
Constructor Summary
Constructors Constructor Description Log4JLoggerWrapper(Class pClass)
Creates a wrapper for the log4j logger for the given class.Log4JLoggerWrapper(String pCategoryName)
Creates a wrapper for the log4j logger for the given category name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
debug(Object msg)
Log a message with debug log level.void
debug(Object msg, Throwable t)
Log an error with debug log level.void
error(Object msg)
Log a message with error log level.void
error(Object msg, Throwable t)
Log an error with error log level.void
fatal(Object msg)
Log a message with fatal log level.void
fatal(Object msg, Throwable t)
Log an error with fatal log level.ILogger.Level
getLevel()
Returns the current minimum logging level logged by this instance.void
info(Object msg)
Log a message with info log level.void
info(Object msg, Throwable t)
Log an error with info log level.boolean
isDebugEnabled()
Is debug logging currently enabled?boolean
isErrorEnabled()
Is error logging currently enabled?boolean
isFatalEnabled()
Is fatal logging currently enabled?boolean
isInfoEnabled()
Is info logging currently enabled?boolean
isWarnEnabled()
Is warn logging currently enabled?void
setLevel(ILogger.Level level)
Sets the minimum logging level logged by this logger instance.void
warn(Object msg)
Log a message with warn log level.void
warn(Object msg, Throwable t)
Log an error with warn log level.
-
-
-
Constructor Detail
-
Log4JLoggerWrapper
public Log4JLoggerWrapper(Class pClass)
Creates a wrapper for the log4j logger for the given class.- See Also:
Logger.getLogger(java.lang.Class)
-
Log4JLoggerWrapper
public Log4JLoggerWrapper(String pCategoryName)
Creates a wrapper for the log4j logger for the given category name.- See Also:
Logger.getLogger(java.lang.String)
-
-
Method Detail
-
debug
public void debug(Object msg)
Description copied from interface:ILogger
Log a message with debug log level.
-
debug
public void debug(Object msg, Throwable t)
Description copied from interface:ILogger
Log an error with debug log level.
-
error
public void error(Object msg)
Description copied from interface:ILogger
Log a message with error log level.
-
error
public void error(Object msg, Throwable t)
Description copied from interface:ILogger
Log an error with error log level.
-
fatal
public void fatal(Object msg)
Description copied from interface:ILogger
Log a message with fatal log level.
-
fatal
public void fatal(Object msg, Throwable t)
Description copied from interface:ILogger
Log an error with fatal log level.
-
info
public void info(Object msg)
Description copied from interface:ILogger
Log a message with info log level.
-
info
public void info(Object msg, Throwable t)
Description copied from interface:ILogger
Log an error with info log level.
-
isDebugEnabled
public boolean isDebugEnabled()
Description copied from interface:ILogger
Is debug logging currently enabled?
Call this method to prevent having to perform expensive operations (for example,
String
concatenation) when the log level is more than debug.- Specified by:
isDebugEnabled
in interfaceILogger
-
isInfoEnabled
public boolean isInfoEnabled()
Description copied from interface:ILogger
Is info logging currently enabled?
Call this method to prevent having to perform expensive operations (for example,
String
concatenation) when the log level is more than info.- Specified by:
isInfoEnabled
in interfaceILogger
-
isWarnEnabled
public boolean isWarnEnabled()
Description copied from interface:ILogger
Is warn logging currently enabled?
Call this method to prevent having to perform expensive operations (for example,
String
concatenation) when the log level is more than warn.- Specified by:
isWarnEnabled
in interfaceILogger
-
isErrorEnabled
public boolean isErrorEnabled()
Description copied from interface:ILogger
Is error logging currently enabled?
Call this method to prevent having to perform expensive operations (for example,
String
concatenation) when the log level is more than error.- Specified by:
isErrorEnabled
in interfaceILogger
-
isFatalEnabled
public boolean isFatalEnabled()
Description copied from interface:ILogger
Is fatal logging currently enabled?
Call this method to prevent having to perform expensive operations (for example,
String
concatenation) when the log level is more than fatal.- Specified by:
isFatalEnabled
in interfaceILogger
-
warn
public void warn(Object msg)
Description copied from interface:ILogger
Log a message with warn log level.
-
warn
public void warn(Object msg, Throwable t)
Description copied from interface:ILogger
Log an error with warn log level.
-
getLevel
public ILogger.Level getLevel()
Description copied from interface:ILogger
Returns the current minimum logging level logged by this instance.
-
setLevel
public void setLevel(ILogger.Level level)
Description copied from interface:ILogger
Sets the minimum logging level logged by this logger instance.
-
-