com.bstek.dorado.console
public class Logger extends java.lang.Object
Dorado 控制台单独管理日志, 用户可在Dorado 配置文件中单独配置控制台日志级别 默认日志级别与运行模式有关如果是production模式下则直接关闭的 其它模式下默认级别为debug 例子: configure.properties[dorado.console.logLevel=debug] 则输出日志级别>=debug日志 也可通过configure.properties[dorado.console.logLevel=off]完全关闭 日志级别分类[all,trace,debug,info,warn,error,fatal,off]
Modifier and Type | Field and Description |
---|---|
static int |
LOG_LEVEL_ALL
Enable all logging levels
|
static int |
LOG_LEVEL_DEBUG
"Debug" level logging.
|
static int |
LOG_LEVEL_ERROR
"Error" level logging.
|
static int |
LOG_LEVEL_FATAL
"Fatal" level logging.
|
static int |
LOG_LEVEL_INFO
"Info" level logging.
|
static int |
LOG_LEVEL_OFF
Enable no logging levels
|
static int |
LOG_LEVEL_TRACE
"Trace" level logging.
|
static int |
LOG_LEVEL_WARN
"Warn" level logging.
|
Modifier and Type | Method and Description |
---|---|
void |
debug(java.lang.Object message)
Log a message with debug log level.
|
void |
debug(java.lang.Object message,
java.lang.Throwable t)
Log an error with debug log level.
|
void |
error(java.lang.Object message)
Log a message with error log level.
|
void |
error(java.lang.Object message,
java.lang.Throwable t)
Log an error with error log level.
|
void |
fatal(java.lang.Object message)
Log a message with fatal log level.
|
void |
fatal(java.lang.Object message,
java.lang.Throwable t)
Log an error with fatal log level.
|
static Logger |
getLog(java.lang.Class<?> clazz)
Convenience method to return a named logger, without the application
having to care about factories.
|
static Logger |
getLog(java.lang.String name)
Convenience method to return a named logger, without the application
having to care about factories.
|
org.apache.commons.logging.Log |
getLogger() |
static int |
getLogLevel() |
void |
info(java.lang.Object message)
Log a message with info log level.
|
void |
info(java.lang.Object message,
java.lang.Throwable t)
Log an error with info log level.
|
protected void |
log(int type,
java.lang.Object message,
java.lang.Throwable t)
Do the actual logging.
|
void |
setLogger(org.apache.commons.logging.Log logger) |
void |
trace(java.lang.Object message)
Log a message with trace log level.
|
void |
trace(java.lang.Object message,
java.lang.Throwable t)
Log an error with trace log level.
|
void |
warn(java.lang.Object message)
Log a message with warn log level.
|
void |
warn(java.lang.Object message,
java.lang.Throwable t)
Log an error with warn log level.
|
public static final int LOG_LEVEL_TRACE
public static final int LOG_LEVEL_DEBUG
public static final int LOG_LEVEL_INFO
public static final int LOG_LEVEL_WARN
public static final int LOG_LEVEL_ERROR
public static final int LOG_LEVEL_FATAL
public static final int LOG_LEVEL_ALL
public static final int LOG_LEVEL_OFF
public static int getLogLevel()
public static Logger getLog(java.lang.Class<?> clazz) throws org.apache.commons.logging.LogConfigurationException
clazz
- Class from which a log name will be derivedorg.apache.commons.logging.LogConfigurationException
- if a suitable Log
instance cannot be returnedpublic static Logger getLog(java.lang.String name) throws org.apache.commons.logging.LogConfigurationException
name
- Logical name of the Log
instance to be returned
(the meaning of this name is only known to the underlying
logging implementation that is being wrapped)org.apache.commons.logging.LogConfigurationException
- if a suitable Log
instance cannot be returnedpublic org.apache.commons.logging.Log getLogger()
public void setLogger(org.apache.commons.logging.Log logger)
protected void log(int type, java.lang.Object message, java.lang.Throwable t)
Do the actual logging. This method assembles the message and then calls
type
- One of the LOG_LEVEL_XXX constants defining the log levelmessage
- The message itself (typically a String)t
- The exception whose stack trace should be loggedpublic void trace(java.lang.Object message)
Log a message with trace log level.
message
- log this messagepublic void trace(java.lang.Object message, java.lang.Throwable t)
Log an error with trace log level.
message
- log this messaget
- log this causepublic void debug(java.lang.Object message)
Log a message with debug log level.
message
- log this messagepublic void debug(java.lang.Object message, java.lang.Throwable t)
Log an error with debug log level.
message
- log this messaget
- log this causepublic void info(java.lang.Object message)
Log a message with info log level.
message
- log this messagepublic void info(java.lang.Object message, java.lang.Throwable t)
Log an error with info log level.
message
- log this messaget
- log this causepublic void warn(java.lang.Object message)
Log a message with warn log level.
message
- log this messagepublic void warn(java.lang.Object message, java.lang.Throwable t)
Log an error with warn log level.
message
- log this messaget
- log this causepublic void error(java.lang.Object message)
Log a message with error log level.
message
- log this messagepublic void error(java.lang.Object message, java.lang.Throwable t)
Log an error with error log level.
message
- log this messaget
- log this causepublic void fatal(java.lang.Object message)
Log a message with fatal log level.
message
- log this messagepublic void fatal(java.lang.Object message, java.lang.Throwable t)
Log an error with fatal log level.
message
- log this messaget
- log this causeCopyright © 2001-2011 www.BSTEK.com All Rights Reserved.