LogFactory, classes that implement
this interface must have a constructor that takes a single String
parameter representing the "name" of this Log.
The six logging levels used by Log are (in order):
Performance is often a logging concern. By examining the appropriate property, a component can avoid expensive operations (producing information to be logged).
For example,
if (log.isDebugEnabled()) {
... do something expensive ...
log.debug(theResult);
}
Configuration of the underlying logging system will generally be done external to the Logging APIs, through whatever mechanism is supported by that system.
spring-jcl variant)
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public boolean | Returns: true if debug is enabled in the underlying logger.Is debug logging currently enabled? |
| public boolean | Returns: true if error is enabled in the underlying logger.Is error logging currently enabled? |
| public boolean | Returns: true if fatal is enabled in the underlying logger.Is fatal logging currently enabled? |
| public boolean | Returns: true if info is enabled in the underlying logger.Is info logging currently enabled? |
| public boolean | Returns: true if trace is enabled in the underlying logger.Is trace logging currently enabled? |
| public boolean | Returns: true if warn is enabled in the underlying logger.Is warn logging currently enabled? |
| public void | |
| public void | |
| public void | |
| public void |
| debug | back to summary |
|---|---|
| public void debug(Object message) Logs a message with debug log level.
| |
| debug | back to summary |
|---|---|
| public void debug(Object message, Throwable t) Logs an error with debug log level. | |
| error | back to summary |
|---|---|
| public void error(Object message) Logs a message with error log level.
| |
| error | back to summary |
|---|---|
| public void error(Object message, Throwable t) Logs an error with error log level. | |
| fatal | back to summary |
|---|---|
| public void fatal(Object message) Logs a message with fatal log level.
| |
| fatal | back to summary |
|---|---|
| public void fatal(Object message, Throwable t) Logs an error with fatal log level. | |
| info | back to summary |
|---|---|
| public void info(Object message) Logs a message with info log level.
| |
| info | back to summary |
|---|---|
| public void info(Object message, Throwable t) Logs an error with info log level. | |
| isDebugEnabled | back to summary |
|---|---|
| public boolean isDebugEnabled() Is debug logging currently enabled? Call this method to prevent having to perform expensive operations
(for example,
| |
| isErrorEnabled | back to summary |
|---|---|
| public boolean isErrorEnabled() Is error logging currently enabled? Call this method to prevent having to perform expensive operations
(for example,
| |
| isFatalEnabled | back to summary |
|---|---|
| public boolean isFatalEnabled() Is fatal logging currently enabled? Call this method to prevent having to perform expensive operations
(for example,
| |
| isInfoEnabled | back to summary |
|---|---|
| public boolean isInfoEnabled() Is info logging currently enabled? Call this method to prevent having to perform expensive operations
(for example,
| |
| isTraceEnabled | back to summary |
|---|---|
| public boolean isTraceEnabled() Is trace logging currently enabled? Call this method to prevent having to perform expensive operations
(for example,
| |
| isWarnEnabled | back to summary |
|---|---|
| public boolean isWarnEnabled() Is warn logging currently enabled? Call this method to prevent having to perform expensive operations
(for example,
| |
| trace | back to summary |
|---|---|
| public void trace(Object message) Logs a message with trace log level.
| |
| trace | back to summary |
|---|---|
| public void trace(Object message, Throwable t) Logs an error with trace log level. | |
| warn | back to summary |
|---|---|
| public void warn(Object message) Logs a message with warn log level.
| |
| warn | back to summary |
|---|---|
| public void warn(Object message, Throwable t) Logs an error with warn log level. | |