public class Log4JLoggerWrapper extends Object implements ILogger
ILogger
that delegates the
calls to the log4j library.
This class also configures the log4j library to use the
configuration file at <configPath>/lumislogconfig.xml
.
ILogger
ILogger.Level
Modifier and Type | Field and Description |
---|---|
protected org.apache.log4j.Logger |
log4jLogger
The log4j logger instance that is being wrapped.
|
Constructor and 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.
|
Modifier and Type | Method and 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.
|
protected org.apache.log4j.Logger log4jLogger
public Log4JLoggerWrapper(Class pClass)
Logger.getLogger(java.lang.Class)
public Log4JLoggerWrapper(String pCategoryName)
Logger.getLogger(java.lang.String)
public void debug(Object msg)
ILogger
Log a message with debug log level.
public void debug(Object msg, Throwable t)
ILogger
Log an error with debug log level.
public void error(Object msg)
ILogger
Log a message with error log level.
public void error(Object msg, Throwable t)
ILogger
Log an error with error log level.
public void fatal(Object msg)
ILogger
Log a message with fatal log level.
public void fatal(Object msg, Throwable t)
ILogger
Log an error with fatal log level.
public void info(Object msg)
ILogger
Log a message with info log level.
public void info(Object msg, Throwable t)
ILogger
Log an error with info log level.
public boolean isDebugEnabled()
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.
isDebugEnabled
in interface ILogger
public boolean isInfoEnabled()
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.
isInfoEnabled
in interface ILogger
public boolean isWarnEnabled()
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.
isWarnEnabled
in interface ILogger
public boolean isErrorEnabled()
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.
isErrorEnabled
in interface ILogger
public boolean isFatalEnabled()
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.
isFatalEnabled
in interface ILogger
public void warn(Object msg)
ILogger
Log a message with warn log level.
public void warn(Object msg, Throwable t)
ILogger
Log an error with warn log level.
public ILogger.Level getLevel()
ILogger
public void setLevel(ILogger.Level level)
ILogger
LumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.