public class DefaultLogger extends AbstractLogger
Default Logger
implementation that delegates to Apache Commons
Logging (if present), or JDK java.util.Logging
(if present),
or simply writes to System.out
.
Modifier and Type | Field and Description |
---|---|
protected Logger |
logger
The
Logger instance we should delegate to (if any). |
Constructor and Description |
---|
DefaultLogger()
Construct a new DefaultLogger instance, deciding which
Logger implementation, if any, we should delegate to. |
Modifier and Type | Method and Description |
---|---|
void |
debug(String name,
String message,
Throwable exception,
Object[] params)
Log a message at debug severity.
|
void |
error(String name,
String message,
Throwable exception,
Object[] params)
Log a message at error severity.
|
void |
fatal(String name,
String message,
Throwable exception,
Object[] params)
Log a message at fatal severity.
|
void |
info(String name,
String message,
Throwable exception,
Object[] params)
Log a message at info severity.
|
boolean |
isDebugEnabled(String name)
Is debug level debugging enabled on the specified logger?
|
boolean |
isErrorEnabled(String name)
Is error level debugging enabled on the specified logger?
|
boolean |
isFatalEnabled(String name)
Is fatal level debugging enabled on the specified logger?
|
boolean |
isInfoEnabled(String name)
Is info level debugging enabled on the specified logger?
|
boolean |
isTraceEnabled(String name)
Is trace level debugging enabled on the specified logger?
|
boolean |
isWarnEnabled(String name)
Is warning level debugging enabled on the specified logger?
|
void |
trace(String name,
String message,
Throwable exception,
Object[] params)
Log a message at trace severity.
|
void |
warn(String name,
String message,
Throwable exception,
Object[] params)
Log a message at warning severity.
|
message
public DefaultLogger()
Construct a new DefaultLogger instance, deciding which
Logger
implementation, if any, we should delegate to.
public boolean isTraceEnabled(String name)
Is trace level debugging enabled on the specified logger?
name
- Name of the logger to checkpublic boolean isDebugEnabled(String name)
Is debug level debugging enabled on the specified logger?
name
- Name of the logger to checkpublic boolean isInfoEnabled(String name)
Is info level debugging enabled on the specified logger?
name
- Name of the logger to checkpublic boolean isWarnEnabled(String name)
Is warning level debugging enabled on the specified logger?
name
- Name of the logger to checkpublic boolean isErrorEnabled(String name)
Is error level debugging enabled on the specified logger?
name
- Name of the logger to checkpublic boolean isFatalEnabled(String name)
Is fatal level debugging enabled on the specified logger?
name
- Name of the logger to checkpublic void trace(String name, String message, Throwable exception, Object[] params)
Log a message at trace severity.
name
- Name of the logger to usemessage
- Text message to record (treated as a message format if
the params
argument is not null)exception
- Exception to report, or null
for noneparams
- Message4 format replacement parameters, or
null
for nonepublic void debug(String name, String message, Throwable exception, Object[] params)
Log a message at debug severity.
name
- Name of the logger to usemessage
- Text message to record (treated as a message format if
the params
argument is not null)exception
- Exception to report, or null
for noneparams
- Message4 format replacement parameters, or
null
for nonepublic void info(String name, String message, Throwable exception, Object[] params)
Log a message at info severity.
name
- Name of the logger to usemessage
- Text message to record (treated as a message format if
the params
argument is not null)exception
- Exception to report, or null
for noneparams
- Message4 format replacement parameters, or
null
for nonepublic void warn(String name, String message, Throwable exception, Object[] params)
Log a message at warning severity.
name
- Name of the logger to usemessage
- Text message to record (treated as a message format if
the params
argument is not null)exception
- Exception to report, or null
for noneparams
- Message4 format replacement parameters, or
null
for nonepublic void error(String name, String message, Throwable exception, Object[] params)
Log a message at error severity.
name
- Name of the logger to usemessage
- Text message to record (treated as a message format if
the params
argument is not null)exception
- Exception to report, or null
for noneparams
- Message4 format replacement parameters, or
null
for nonepublic void fatal(String name, String message, Throwable exception, Object[] params)
Log a message at fatal severity.
name
- Name of the logger to usemessage
- Text message to record (treated as a message format if
the params
argument is not null)exception
- Exception to report, or null
for noneparams
- Message4 format replacement parameters, or
null
for noneCopyright © 2004-2013 Apache Software Foundation. All Rights Reserved.