|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.Restlet
org.restlet.routing.Filter
org.restlet.engine.log.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.routing.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.routing.Filter |
---|
doHandle, getNext, handle, hasNext, setNext, setNext, start, stop |
Methods inherited from class org.restlet.Restlet |
---|
finalize, getApplication, getAuthor, getContext, getDescription, getLogger, getName, getOwner, isStarted, isStopped, setAuthor, setContext, setDescription, setName, setOwner |
Methods inherited from class java.lang.Object |
---|
clone, equals, 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 Filter
request
- The request to handle.response
- The response to update.protected int beforeHandle(Request request, Response response)
beforeHandle
in class Filter
request
- 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 |