|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.click.service.ConsoleLogService
Provides a Log Service class which will log messages to the console or System.out.
ConsoleLogService is the defaultLogService
for Click.
However you can instruct Click to use a different log service implementation.
Please see LogService
for more details.
Field Summary | |
static int |
DEBUG_LEVEL
The debug logging level. |
static int |
ERROR_LEVEL
The error logging level. |
static int |
INFO_LEVEL
The info logging level. |
protected static String[] |
LEVELS
The level names. |
protected int |
logLevel
The logging level. |
protected String |
name
The log name. |
static int |
TRACE_LEVEL
The trace logging level. |
static int |
WARN_LEVEL
The warn logging level. |
Constructor Summary | |
ConsoleLogService()
|
Method Summary | |
void |
debug(Object message)
Log the given message at [debug] logging level. |
void |
debug(Object message,
Throwable error)
Log the given message and error at [debug] logging level. |
void |
error(Object message)
Log the given message at [error] logging level. |
void |
error(Object message,
Throwable error)
Log the given message and error at [error] logging level. |
void |
info(Object message)
Log the given message at [info] logging level. |
void |
info(Object message,
Throwable error)
Log the given message and error at [info] logging level. |
boolean |
isDebugEnabled()
Return true if [debug] level logging is enabled. |
boolean |
isInfoEnabled()
Return true if [info] level logging is enabled. |
boolean |
isTraceEnabled()
Return true if [trace] level logging is enabled. |
protected void |
log(int level,
String message,
Throwable error)
Log the given message and optional error at the specified logging level. |
void |
onDestroy()
Destroy the LogService. |
void |
onInit(ServletContext servletContext)
Initialize the LogService with the given application servlet context. |
void |
setLevel(int level)
Set the logging level [ TRACE_LEVEL | DEBUG_LEVEL | INFO_LEVEL | WARN_LEVEL | ERROR_LEVEL ]. |
void |
trace(Object message)
Log the given message at [trace] logging level. |
void |
trace(Object message,
Throwable error)
Log the given message and error at [trace] logging level. |
void |
warn(Object message)
Log the given message at [warn] logging level. |
void |
warn(Object message,
Throwable error)
Log the given message and error at [warn] logging level. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TRACE_LEVEL
public static final int DEBUG_LEVEL
public static final int INFO_LEVEL
public static final int WARN_LEVEL
public static final int ERROR_LEVEL
protected static final String[] LEVELS
protected int logLevel
protected String name
Constructor Detail |
public ConsoleLogService()
Method Detail |
public void onInit(ServletContext servletContext) throws Exception
LogService
ConfigService
by invoking
ClickUtils.getConfigService(javax.servlet.ServletContext)
onInit
in interface LogService
servletContext
- the application servlet context
Exception
- if an error occurs initializing the LogServiceLogService.onInit(ServletContext)
public void onDestroy()
LogService
onDestroy
in interface LogService
LogService.onDestroy()
public void setLevel(int level)
level
- the logging levelpublic void debug(Object message)
LogService
debug
in interface LogService
message
- the message to logLogService.debug(Object)
public void debug(Object message, Throwable error)
LogService
debug
in interface LogService
message
- the message to logerror
- the error to logLogService.debug(Object, Throwable)
public void error(Object message)
LogService
error
in interface LogService
message
- the message to logLogService.error(Object)
public void error(Object message, Throwable error)
LogService
error
in interface LogService
message
- the message to logerror
- the error to logLogService.error(Object, Throwable)
public void info(Object message)
LogService
info
in interface LogService
message
- the message to logLogService.info(Object)
public void info(Object message, Throwable error)
LogService
info
in interface LogService
message
- the message to logerror
- the error to logLogService.info(Object, Throwable)
public void trace(Object message)
LogService
trace
in interface LogService
message
- the message to logLogService.trace(Object)
public void trace(Object message, Throwable error)
LogService
trace
in interface LogService
message
- the message to logerror
- the error to logLogService.trace(Object, Throwable)
public void warn(Object message)
LogService
warn
in interface LogService
message
- the message to logLogService.warn(Object)
public void warn(Object message, Throwable error)
LogService
warn
in interface LogService
message
- the message to logerror
- the error to logLogService.warn(Object, Throwable)
public boolean isDebugEnabled()
LogService
isDebugEnabled
in interface LogService
LogService.isDebugEnabled()
public boolean isInfoEnabled()
LogService
isInfoEnabled
in interface LogService
LogService.isInfoEnabled()
public boolean isTraceEnabled()
LogService
isTraceEnabled
in interface LogService
LogService.isTraceEnabled()
protected void log(int level, String message, Throwable error)
level
- the logging levelmessage
- the message to logerror
- the optional error to log
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |