|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectraccoon.core.types.AbsComponent
raccoon.core.types.AbsLoadable
raccoon.core.types.AbsConfigurableLoadable
raccoon.core.log.AbsLogComponent
raccoon.core.log.Log4jProxy
public final class Log4jProxy
Wrapper around the IBM Log4j implementation.
This implementation has now moved to the Apache project and is packaged as org.apache.log4j
.
log4j.appender.Raccoon = org.apache.log4j.RollingFileAppender
log4j.appender.Raccoon.File = Raccoon.log
log4j.appender.Raccoon.Append = false
log4j.appender.Raccoon.MaxFileSize = 5MB
log4j.appender.Raccoon.MaxBackupIndex = 10
log4j.appender.Raccoon.layout = org.apache.log4j.PatternLayout
log4j.appender.Raccoon.layout.ConversionPattern = %r [%t] %-5p %c{2} %x - %m %n
log4j.rootLogger=debug, Raccoon
Field Summary |
---|
Fields inherited from class raccoon.core.log.AbsLogComponent |
---|
LOGGER_NAME, mLoggerName, mPropertyFileName, PROPERTY_FILE_NAME |
Fields inherited from class raccoon.core.types.AbsConfigurableLoadable |
---|
mConfigurableManager |
Fields inherited from class raccoon.core.types.AbsLoadable |
---|
mIsLoaded |
Fields inherited from class raccoon.core.types.AbsComponent |
---|
mIsInError |
Fields inherited from interface raccoon.api.log.ILogger |
---|
LEVEL_DEBUG, LEVEL_ERROR, LEVEL_INFO, LEVEL_WARN, PTY_LOGGER |
Constructor Summary | |
---|---|
Log4jProxy()
|
Method Summary | |
---|---|
void |
configureParameters()
Configures the various parameters for this component. |
void |
debug(java.lang.String pMessage)
Inserts a String into the log only if the DEBUG
level is enabled |
void |
debug(java.lang.String pMessage,
java.lang.Object[] pParams)
Inserts a String into the log only if the DEBUG
level is enabled. |
void |
debug(java.lang.String pMessage,
java.lang.Object[] pParams,
java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log
only if the DEBUG level is enabled |
void |
debug(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log
only if the DEBUG level is enabled |
java.lang.String |
debugLevelToString()
The debug level as a string |
void |
error(java.lang.String pMessage)
Inserts a String into the log only if the ERROR
level is enabled |
void |
error(java.lang.String pMessage,
java.lang.Object[] pParams)
Inserts a String into the log only if the ERROR
level is enabled. |
void |
error(java.lang.String pMessage,
java.lang.Object[] pParams,
java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log
only if the ERROR level is enabled |
void |
error(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log
only if the ERROR level is enabled |
java.lang.String |
errorLevelToString()
The error level as a string |
protected void |
getLogInstance()
Instanciates the logging element. |
void |
info(java.lang.String pMessage)
Inserts a String into the log only if the INFO
level is enabled. |
void |
info(java.lang.String pMessage,
java.lang.Object[] pParams)
Inserts a String into the log only if the INFO
level is enabled. |
void |
info(java.lang.String pMessage,
java.lang.Object[] pParams,
java.lang.Throwable pThrowable)
Insert a String and an exception into the log
only if the INFO level is enabled. |
void |
info(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log
only if the INFO level is enabled. |
java.lang.String |
infoLevelToString()
The info level as a string |
boolean |
isDebugEnabled()
Checks if debug mode is enabled. |
boolean |
isErrorEnabled()
Returns true if error mode is enabled. |
boolean |
isInfoEnabled()
Checks if info mode is enabled. |
boolean |
isWarnEnabled()
Returns true if warn mode is enabled. |
protected void |
loadLoggers()
Loads the various loggers required to function. |
void |
warn(java.lang.String pMessage)
Inserts a String into the log only if the WARN
level is enabled |
void |
warn(java.lang.String pMessage,
java.lang.Object[] pParams)
Inserts a String into the log only if the WARN
level is enabled. |
void |
warn(java.lang.String pMessage,
java.lang.Object[] pParams,
java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log
only if the WARN level is enabled |
void |
warn(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Inserts a String and an Exception into the log
only if the WARN level is enabled |
java.lang.String |
warnLevelToString()
The warn level as a string |
Methods inherited from class raccoon.core.log.AbsLogComponent |
---|
getCallingClassLevel, getCategoryName, getLoggerName, getPropertyFileName, load, setCallingClassLevel, setCategoryName, setLoggerName, setPropertyFileName |
Methods inherited from class raccoon.core.types.AbsConfigurableLoadable |
---|
isStable, setConfigurableManager, setLogger |
Methods inherited from class raccoon.core.types.AbsLoadable |
---|
getLog, isInError, isInitialised, isRunning, unload |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface raccoon.api.log.ILogger |
---|
getCategoryName, getLoggerName, setCategoryName, setLoggerName |
Constructor Detail |
---|
public Log4jProxy()
Method Detail |
---|
public boolean isDebugEnabled()
isDebugEnabled
in interface ILogger
public boolean isInfoEnabled()
isInfoEnabled
in interface ILogger
true
if info mode is enabledpublic boolean isWarnEnabled()
true
if warn mode is enabled. Use this method to
avoid unnecessary String construction when calling the warn method.
isWarnEnabled
in interface ILogger
true
if warn mode is enabledpublic boolean isErrorEnabled()
true
if error mode is enabled. Use this method to
avoid unnecessary String construction when calling the error method.
isErrorEnabled
in interface ILogger
true
if error mode is enabledpublic void configureParameters()
IConfigurableManager
provided
during the invocation of AbsConfigurableLoadable.setConfigurableManager(raccoon.api.types.IConfigurableManager)
.
configureParameters
in interface IConfigurable
configureParameters
in class AbsConfigurableLoadable
protected void getLogInstance()
getLogInstance
in class AbsLogComponent
protected void loadLoggers() throws LoadableException
loadLoggers
in class AbsLogComponent
LoadableException
- if the loggers couldn't be correctly loaded.public java.lang.String debugLevelToString()
debugLevelToString
in class AbsLogComponent
public java.lang.String infoLevelToString()
infoLevelToString
in class AbsLogComponent
public java.lang.String warnLevelToString()
warnLevelToString
in class AbsLogComponent
public java.lang.String errorLevelToString()
errorLevelToString
in class AbsLogComponent
public void info(java.lang.String pMessage)
String
into the log only if the INFO
level is enabled.
info
in interface ILogger
pMessage
- the message to log.public void info(java.lang.String pMessage, java.lang.Throwable pThrowable)
String
and an Exception
into the log
only if the INFO
level is enabled.
info
in interface ILogger
pMessage
- the message to log.pThrowable
- the throwable to log.public void info(java.lang.String pMessage, java.lang.Object[] pParams)
String
into the log only if the INFO
level is enabled.
The String
is of course a specific String, because each occurrence
of {i} in that String will be replaced by Object[i].toString()
info("Hello {0}, you have {1}, new Object[] {"Kathleen", "mail"});
info("Hello Kathleen, you have mail");
info
in interface ILogger
pMessage
- the message to log.pParams
- a list of objects that implement the toString() method.public void info(java.lang.String pMessage, java.lang.Object[] pParams, java.lang.Throwable pThrowable)
String
and an exception
into the log
only if the INFO
level is enabled.
info
in interface ILogger
pMessage
- the message to log.pParams
- a list of objects that implement the toString() method.pThrowable
- the throwable to log.info(String, Object[])
public void debug(java.lang.String pMessage)
String
into the log only if the DEBUG
level is enabled
debug
in interface ILogger
pMessage
- the message to log.public void debug(java.lang.String pMessage, java.lang.Throwable pThrowable)
String
and an Exception
into the log
only if the DEBUG
level is enabled
debug
in interface ILogger
pMessage
- the message to log.pThrowable
- the throwable to log.public void debug(java.lang.String pMessage, java.lang.Object[] pParams)
String
into the log only if the DEBUG
level is enabled.
debug
in interface ILogger
pMessage
- the message to log.pParams
- a list of objects that implement the toString() method.info(String, Object[])
public void debug(java.lang.String pMessage, java.lang.Object[] pParams, java.lang.Throwable pThrowable)
String
and an Exception
into the log
only if the DEBUG
level is enabled
debug
in interface ILogger
pMessage
- the message to log.pParams
- a list of objects that implement the toString() method.pThrowable
- the throwable to log.info(String, Object[], Throwable)
public void warn(java.lang.String pMessage)
String
into the log only if the WARN
level is enabled
warn
in interface ILogger
pMessage
- the message to log.public void warn(java.lang.String pMessage, java.lang.Throwable pThrowable)
String
and an Exception
into the log
only if the WARN
level is enabled
warn
in interface ILogger
pThrowable
- the throwable to log.pMessage
- the message to log.public void warn(java.lang.String pMessage, java.lang.Object[] pParams)
String
into the log only if the WARN
level is enabled.
warn
in interface ILogger
pMessage
- the message to log.pParams
- a list of objects that implement the toString() method.info(String, Object[])
public void warn(java.lang.String pMessage, java.lang.Object[] pParams, java.lang.Throwable pThrowable)
String
and an Exception
into the log
only if the WARN
level is enabled
warn
in interface ILogger
pMessage
- the message to log.pParams
- a list of objects that implement the toString() method.pThrowable
- the throwable to log.info(String, Object[], Throwable)
public void error(java.lang.String pMessage)
String
into the log only if the ERROR
level is enabled
error
in interface ILogger
pMessage
- the message to log.public void error(java.lang.String pMessage, java.lang.Throwable pThrowable)
String
and an Exception
into the log
only if the ERROR
level is enabled
error
in interface ILogger
pThrowable
- the throwable to log.pMessage
- the message to log.public void error(java.lang.String pMessage, java.lang.Object[] pParams)
String
into the log only if the ERROR
level is enabled.
error
in interface ILogger
pMessage
- the message to log.pParams
- a list of objects that implement the toString() method.info(String, Object[])
public void error(java.lang.String pMessage, java.lang.Object[] pParams, java.lang.Throwable pThrowable)
String
and an Exception
into the log
only if the ERROR
level is enabled
error
in interface ILogger
pMessage
- the message to log.pParams
- a list of objects that implement the toString() method.pThrowable
- the throwable to log.info(String, Object[], Throwable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |