SimpleLog |
public class SimpleLog implements Log,Serializable(Code) |
| Simple implementation of Log that sends all enabled log messages,
for all defined loggers, to System.err. The following system properties
are supported to configure the behavior of this logger:
org.apache.commons.logging.simplelog.defaultlog -
Default logging detail level for all instances of SimpleLog.
Must be one of ("trace", "debug", "info", "warn", "error", or "fatal").
If not specified, defaults to "info".
org.apache.commons.logging.simplelog.log.xxxxx -
Logging detail level for a SimpleLog instance named "xxxxx".
Must be one of ("trace", "debug", "info", "warn", "error", or "fatal").
If not specified, the default logging detail level is used.
org.apache.commons.logging.simplelog.showlogname -
Set to true if you want the Log instance name to be
included in output messages. Defaults to false .
org.apache.commons.logging.simplelog.showShortLogname -
Set to true if you want the last component of the name to be
included in output messages. Defaults to true .
org.apache.commons.logging.simplelog.showdatetime -
Set to true if you want the current date and time
to be included in output messages. Default is false .
org.apache.commons.logging.simplelog.dateTimeFormat -
The date and time format to be used in the output messages.
The pattern describing the date and time format is the same that is
used in java.text.SimpleDateFormat . If the format is not
specified or is invalid, the default format is used.
The default format is yyyy/MM/dd HH:mm:ss:SSS zzz .
In addition to looking for system properties with the names specified
above, this implementation also checks for a class loader resource named
"simplelog.properties" , and includes any matching definitions
from this resource (if it exists).
author: Scott Sanders author: Rod Waldhoff author: Robert Burrell Donkin version: $Id: SimpleLog.java 399221 2006-05-03 09:20:24Z dennisl $ |
Method Summary |
|
final public void | debug(Object message) Logs a message with
org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_DEBUG . |
final public void | debug(Object message, Throwable t) Logs a message with
org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_DEBUG . |
final public void | error(Object message) Logs a message with
org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_ERROR . |
final public void | error(Object message, Throwable t) Logs a message with
org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_ERROR . |
final public void | fatal(Object message) Log a message with
org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_FATAL . |
final public void | fatal(Object message, Throwable t) Logs a message with
org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_FATAL . |
public int | getLevel() Get logging level. |
final public void | info(Object message) Logs a message with
org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_INFO . |
final public void | info(Object message, Throwable t) Logs a message with
org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_INFO . |
final public boolean | isDebugEnabled() Are debug messages currently enabled?
This allows expensive operations such as String
concatenation to be avoided when the message will be ignored by the
logger. |
final public boolean | isErrorEnabled() Are error messages currently enabled?
This allows expensive operations such as String
concatenation to be avoided when the message will be ignored by the
logger. |
final public boolean | isFatalEnabled() Are fatal messages currently enabled?
This allows expensive operations such as String
concatenation to be avoided when the message will be ignored by the
logger. |
final public boolean | isInfoEnabled() Are info messages currently enabled?
This allows expensive operations such as String
concatenation to be avoided when the message will be ignored by the
logger. |
protected boolean | isLevelEnabled(int logLevel) |
final public boolean | isTraceEnabled() Are trace messages currently enabled?
This allows expensive operations such as String
concatenation to be avoided when the message will be ignored by the
logger. |
final public boolean | isWarnEnabled() Are warn messages currently enabled?
This allows expensive operations such as String
concatenation to be avoided when the message will be ignored by the
logger. |
protected void | log(int type, Object message, Throwable t) Do the actual logging. |
public void | setLevel(int currentLogLevel) Set logging level. |
final public void | trace(Object message) Logs a message with
org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_TRACE . |
final public void | trace(Object message, Throwable t) Logs a message with
org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_TRACE . |
final public void | warn(Object message) Logs a message with
org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_WARN . |
final public void | warn(Object message, Throwable t) Logs a message with
org.apache.commons.logging.impl.SimpleLog.LOG_LEVEL_WARN . |
protected void | write(StringBuffer buffer) Write the content of the message accumulated in the specified
StringBuffer to the appropriate output destination. |