|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Provides a logging service for the Click runtime.
LogService
implementation is ConsoleLogService
.
You can instruct Click to use a different implementation by adding
the following element to your click.xml configuration file.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <click-app charset="UTF-8"> <pages package="net.sf.click.examples.page"/> <log-service classname="com.mycorp.CustomLogService"/> </click-app>The class com.mycorp.CustomLogService might be defined as follows:
package com.mycorp; public class CustomLogService extends ConsoleLogService { protected void log(int level, String message, Throwable error) { // Add custom logic ... super.log(level, message, error); } }
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. |
void |
onDestroy()
Destroy the LogService. |
void |
onInit(ServletContext servletContext)
Initialize the LogService with the given application servlet context. |
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. |
Method Detail |
public void onInit(ServletContext servletContext) throws Exception
ConfigService
by invoking
ClickUtils.getConfigService(javax.servlet.ServletContext)
servletContext
- the application servlet context
Exception
- if an error occurs initializing the LogServicepublic void onDestroy()
public void debug(Object message)
message
- the message to logpublic void debug(Object message, Throwable error)
message
- the message to logerror
- the error to logpublic void error(Object message)
message
- the message to logpublic void error(Object message, Throwable error)
message
- the message to logerror
- the error to logpublic void info(Object message)
message
- the message to logpublic void info(Object message, Throwable error)
message
- the message to logerror
- the error to logpublic void trace(Object message)
message
- the message to logpublic void trace(Object message, Throwable error)
message
- the message to logerror
- the error to logpublic void warn(Object message)
message
- the message to logpublic void warn(Object message, Throwable error)
message
- the message to logerror
- the error to logpublic boolean isDebugEnabled()
public boolean isInfoEnabled()
public boolean isTraceEnabled()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |