Restlet Framework 2.2 Snapshot
Java Standard Edition

org.restlet.engine.log
Class LogFilter

java.lang.Object
  extended by org.restlet.Restlet
      extended by org.restlet.routing.Filter
          extended by org.restlet.engine.log.LogFilter
All Implemented Interfaces:
Uniform

public class LogFilter
extends Filter

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.

Author:
Jerome Louvel

Field Summary
protected  LogService logService
          The log service.
 
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.
 
Methods inherited from class org.restlet.routing.Filter
doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
 
Methods inherited from class org.restlet.Restlet
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logService

protected volatile LogService logService
The log service.

Constructor Detail

LogFilter

public LogFilter(Context context,
                 LogService logService)
Constructor.

Parameters:
context - The context.
logService - The log service descriptor.
Method Detail

afterHandle

protected void afterHandle(Request request,
                           Response response)
Allows filtering after processing by the next Restlet. Logs the call.

Overrides:
afterHandle in class Filter
Parameters:
request - The request to handle.
response - The response to update.

beforeHandle

protected int beforeHandle(Request request,
                           Response response)
Allows filtering before processing by the next Restlet. Saves the start time.

Overrides:
beforeHandle in class Filter
Parameters:
request - The request to handle.
response - The response to update.
Returns:
The continuation status.

Restlet Framework 2.2 Snapshot
Java Standard Edition

Copyright © 2005-2014 Restlet.