|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.webdocwf.util.loader.logging.Logger
org.webdocwf.util.loader.logging.StandardLogger
public class StandardLogger
Standard implementation of the Logger
. This is
general-purpose logging facility. A client that needs additional
functionality can either extend this class or provide there own
implementationm of Logger
.
Currently this is a bare-bones class that writes INFO and above levels to stderr and all others to a log file.
Logger
Field Summary | |
---|---|
java.io.RandomAccessFile |
randomLoggerFile
|
Fields inherited from class org.webdocwf.util.loader.logging.Logger |
---|
centralLogger, enbledLogLevels, LOGMODE_FULL, LOGMODE_NONE, LOGMODE_NORMAL, standardLevelNames, strLOGMODE_FULL, strLOGMODE_NONE, strLOGMODE_NORMAL |
Constructor Summary | |
---|---|
StandardLogger()
Construct a new logger. |
Method Summary | |
---|---|
void |
close()
|
void |
configure(java.lang.String confFilePath)
Configure Logger with given config file, interpreting of config file is logger implementation specific. |
boolean[] |
getEnabledLogLevels()
|
int |
getLevel(java.lang.String level)
Convert a symbolic level to an integer identifier. |
java.lang.String |
getMessage(java.lang.String key)
|
boolean |
isEnabled(int level)
Determine if logging is enabled for the specified level. |
boolean |
isEnabled(java.lang.String level)
Determine if logging is enabled for the specified level. |
void |
setEnabledLogLevels(java.lang.String logMode)
|
boolean |
setMessage(java.lang.String key,
java.lang.String value)
|
void |
write(int level,
java.lang.String msg)
Write a string to the log file. |
void |
write(int level,
java.lang.String msg,
java.lang.Throwable throwable)
Write a string and exception to the log file. |
void |
write(java.lang.String level,
java.lang.String msg)
Write a string to the log file. |
void |
write(java.lang.String level,
java.lang.String msg,
java.lang.Throwable throwable)
Write a string and exception to the log file. |
boolean |
writeEcho(java.lang.String strLogTxt)
|
Methods inherited from class org.webdocwf.util.loader.logging.Logger |
---|
getCentralLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.io.RandomAccessFile randomLoggerFile
Constructor Detail |
---|
public StandardLogger()
Method Detail |
---|
public void configure(java.lang.String confFilePath) throws java.lang.Exception
configure
in class Logger
confFilePath
- Path to configuration file.
java.lang.Exception
public int getLevel(java.lang.String level)
Logger
getLevel
in class Logger
level
- Symbolic level to convert
public boolean isEnabled(int level)
Logger
isEnabled
in class Logger
level
- Numeric level that is to be checked.
true
if enabled, false
if not
enabled.public boolean isEnabled(java.lang.String level)
Logger
isEnabled
in class Logger
level
- Symbolic level that is to be checked.
true
if enabled, false
if not
enabled.public void write(int level, java.lang.String msg)
Logger
write
in class Logger
level
- Numeric level the message is associated with.msg
- The message to log.public void write(java.lang.String level, java.lang.String msg)
Logger
write
in class Logger
level
- Symbolic level the message is associated with.msg
- The message to log.public void write(int level, java.lang.String msg, java.lang.Throwable throwable)
Logger
write
in class Logger
level
- Numeric level the message is associated with.msg
- The message to log.throwable
- Exception or error to log.public void write(java.lang.String level, java.lang.String msg, java.lang.Throwable throwable)
Logger
write
in class Logger
level
- Symbolic level the message is associated with.msg
- The message to log.throwable
- Exception or error to log.public void setEnabledLogLevels(java.lang.String logMode)
setEnabledLogLevels
in class Logger
public boolean[] getEnabledLogLevels()
getEnabledLogLevels
in class Logger
public java.lang.String getMessage(java.lang.String key)
getMessage
in class Logger
public boolean setMessage(java.lang.String key, java.lang.String value)
setMessage
in class Logger
public boolean writeEcho(java.lang.String strLogTxt)
writeEcho
in class Logger
public void close()
close
in class Logger
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |