|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.restlet.Uniform
org.restlet.Restlet
org.restlet.Filter
com.noelios.restlet.LogFilter
public class LogFilter
Filter logging all calls after their handling by the target Restlet. The current format is similar to IIS 6 logs. The logging is based on the java.util.logging package. Concurrency note: instances of this class or its subclasses can be invoked by several threads at the same time and therefore must be thread-safe. You should be especially careful when storing state in member variables.
| Field Summary | |
|---|---|
protected LogService |
logService
The log service. |
protected Template |
logTemplate
The log template to use. |
| Fields inherited from class org.restlet.Filter |
|---|
CONTINUE, SKIP, STOP |
| Constructor Summary | |
|---|---|
LogFilter(Context context,
LogService logService)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
afterHandle(Request request,
Response response)
Allows filtering after processing by the next Restlet. |
protected int |
beforeHandle(Request request,
Response response)
Allows filtering before processing by the next Restlet. |
protected String |
format(Request request,
Response response)
Format a log entry. |
protected String |
formatDefault(Request request,
Response response,
int duration)
Format a log entry using the default format. |
| Methods inherited from class org.restlet.Filter |
|---|
doHandle, getNext, handle, hasNext, setNext, setNext |
| Methods inherited from class org.restlet.Restlet |
|---|
getApplication, getContext, getLogger, init, isStarted, isStopped, setContext, start, stop |
| Methods inherited from class org.restlet.Uniform |
|---|
delete, delete, get, get, handle, head, head, options, options, post, post, put, put |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected volatile LogService logService
protected volatile Template logTemplate
| Constructor Detail |
|---|
public LogFilter(Context context,
LogService logService)
context - The context.logService - The log service descriptor.| Method Detail |
|---|
protected void afterHandle(Request request,
Response response)
afterHandle in class Filterrequest - The request to handle.response - The response to update.
protected int beforeHandle(Request request,
Response response)
beforeHandle in class Filterrequest - The request to handle.response - The response to update.
protected String format(Request request,
Response response)
request - The request to log.response - The response to log.
protected String formatDefault(Request request,
Response response,
int duration)
request - The request to log.response - The response to log.duration - The call duration (in milliseconds).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||