|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fesenmeyer.dbnormalizer.core.log.DBNormalizerLogger
public class DBNormalizerLogger
Application-specific logging wrapper class based on http://codeelixir.com/2006/06/19/java-logging-made-easy.aspx. Currently wraps log4j-Logging.
Field Summary | |
---|---|
private org.apache.log4j.Logger |
logger
A log4j-Logger. |
private static Map |
loggers
Static HashMap for all loggers. |
Constructor Summary | |
---|---|
private |
DBNormalizerLogger(Class c)
Private Constructor for creating a logger. |
Method Summary | |
---|---|
void |
debug(String message)
Logs a debug message. |
void |
error(String message)
Logs an error with the specified message. |
void |
error(String message,
Throwable t)
Logs an error message with the specified message and error. |
void |
fatal(String message)
Logs a fatal error with the specified message. |
void |
fatal(String message,
Throwable t)
Logs a fatal error message with the specified message and error. |
static DBNormalizerLogger |
getLogger(Class c)
Gets the logger object for the class specified by argument c. |
void |
info(String message)
Logs an info with the specified message. |
boolean |
isDebugLoggable()
Returns if debug messages are loggable. |
boolean |
isErrorLoggable()
Returns if error messages are loggable. |
boolean |
isFatalLoggable()
Returns if fatal error messages are loggable. |
boolean |
isInfoLoggable()
Returns if info messages are loggable. |
boolean |
isWarnLoggable()
Returns if warn messages are loggable. |
private String |
mergeThrowableWithMessage(String message,
Throwable t)
This method includes information about a Throwable t in the message. |
void |
warn(String message)
Logs a warning with the specified message. |
void |
warn(String message,
Throwable t)
Logs a warning with the specified message and error. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private org.apache.log4j.Logger logger
private static final Map loggers
Constructor Detail |
---|
private DBNormalizerLogger(Class c)
c
- Method Detail |
---|
public static DBNormalizerLogger getLogger(Class c)
c
- the class
public boolean isFatalLoggable()
true
, if they are loggable;
false
, otherwisepublic boolean isErrorLoggable()
true
, if they are loggable;
false
, otherwisepublic boolean isWarnLoggable()
true
, if they are loggable;
false
, otherwisepublic boolean isInfoLoggable()
true
, if they are loggable;
false
, otherwisepublic boolean isDebugLoggable()
true
, if they are loggable;
false
, otherwisepublic void fatal(String message)
message
- the messagepublic void fatal(String message, Throwable t)
message
- the messaget
- the error as a Throwable objectpublic void error(String message)
message
- the messagepublic void error(String message, Throwable t)
message
- the messaget
- the error as a Throwable objectpublic void warn(String message)
message
- the messagepublic void warn(String message, Throwable t)
message
- the messaget
- the error as a Throwable objectpublic void info(String message)
message
- the messagepublic void debug(String message)
message
- the messageprivate String mergeThrowableWithMessage(String message, Throwable t)
PatternLayout
does not include the Throwable information and we do not want
to use another more complex layout.
message
- a messaget
- a Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |