|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface LogService
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="org.apache.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 |
|---|
void onInit(ServletContext servletContext)
throws Exception
servletContext - the application servlet context
Exception - if an error occurs initializing the LogServicevoid onDestroy()
void debug(Object message)
message - the message to log
void debug(Object message,
Throwable error)
message - the message to logerror - the error to logvoid error(Object message)
message - the message to log
void error(Object message,
Throwable error)
message - the message to logerror - the error to logvoid info(Object message)
message - the message to log
void info(Object message,
Throwable error)
message - the message to logerror - the error to logvoid trace(Object message)
message - the message to log
void trace(Object message,
Throwable error)
message - the message to logerror - the error to logvoid warn(Object message)
message - the message to log
void warn(Object message,
Throwable error)
message - the message to logerror - the error to logboolean isDebugEnabled()
boolean isInfoEnabled()
boolean isTraceEnabled()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||