|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openejb.util.Logger
public class Logger
This is a wrapper class to the log4j facility. In addition to the internationalization of messages, it sets a default log4j configuration, if one is not already set in the system properties.
If the log4j system complains that there is no configuration set, then it's probably one of two things. First, the config file does not exist. Second, and more likely, the OpenEJB URL handler has not been registered. (Note that the log4j.configuration default setting uses the protocol resource.)
TODO: Create a wrapper to Tomcat logging facility; Make Logger class a factory
Nested Class Summary | |
---|---|
class |
Logger.I18N
|
Field Summary | |
---|---|
protected org.apache.log4j.Category |
_logger
|
protected static java.util.HashMap |
_loggers
|
Logger.I18N |
i18n
|
Constructor Summary | |
---|---|
protected |
Logger(java.lang.String resourceName)
Protected constructor. |
Method Summary | |
---|---|
void |
debug(java.lang.String message)
A wrapper call to log4j's debug method |
void |
debug(java.lang.String message,
java.lang.Throwable t)
An wrapper call to log4j's debug method |
void |
error(java.lang.String message)
A wrapper call to log4j's error method |
void |
error(java.lang.String message,
java.lang.Throwable t)
An wrapper call to log4j's error method |
void |
fatal(java.lang.String message)
A wrapper call to log4j's error method |
void |
fatal(java.lang.String message,
java.lang.Throwable t)
An wrapper call to log4j's fatal method |
static Logger |
getInstance(java.lang.String category,
java.lang.String resourceName)
Returns a shared instance of Logger. |
void |
info(java.lang.String message)
A wrapper call to log4j's error method |
void |
info(java.lang.String message,
java.lang.Throwable t)
An wrapper call to log4j's info method |
static void |
initialize(java.util.Properties props)
|
boolean |
isDebugEnabled()
Wrapper function for log4j's isDebugEnabled() method. |
boolean |
isErrorEnabled()
Check to see if error messages are enabled. |
boolean |
isFatalEnabled()
Check to see if fatal messages are enabled. |
boolean |
isInfoEnabled()
Wrapper function for log4j's isInfoEnabled() method. |
boolean |
isWarningEnabled()
Check to see if warning messages are enabled. |
void |
warning(java.lang.String message)
A wrapper call to log4j's warning method |
void |
warning(java.lang.String message,
java.lang.Throwable t)
An wrapper call to log4j's warning method |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.util.HashMap _loggers
protected org.apache.log4j.Category _logger
public Logger.I18N i18n
Constructor Detail |
---|
protected Logger(java.lang.String resourceName)
resourceName
- the name of the log4j category to useLogger.I18N
Method Detail |
---|
public static void initialize(java.util.Properties props)
public static Logger getInstance(java.lang.String category, java.lang.String resourceName)
category
- the class whose name log4j category will useresourceName
- the name log4j category will use
public boolean isDebugEnabled()
public boolean isErrorEnabled()
public boolean isFatalEnabled()
public boolean isInfoEnabled()
public boolean isWarningEnabled()
public void debug(java.lang.String message)
message
- The debug message to be logged.public void debug(java.lang.String message, java.lang.Throwable t)
message
- The debug message to be logged.t
- the exception to log, including its stack traceMessages
public void error(java.lang.String message)
message
- The error message to be logged.public void error(java.lang.String message, java.lang.Throwable t)
message
- The error message to be logged.t
- the exception to log, including its stack traceMessages
public void fatal(java.lang.String message)
message
- The fatal message to be logged.public void fatal(java.lang.String message, java.lang.Throwable t)
message
- The fatal message to be logged.t
- the exception to log, including its stack traceMessages
public void info(java.lang.String message)
message
- The info message to be logged.public void info(java.lang.String message, java.lang.Throwable t)
message
- The info message to be logged.t
- the exception to log, including its stack traceMessages
public void warning(java.lang.String message)
message
- The warning message to be logged.public void warning(java.lang.String message, java.lang.Throwable t)
message
- The warning message to be logged.t
- the exception to log, including its stack traceMessages
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |