Class 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 Details

    • logService

      protected volatile LogService logService
      The log service.
  • Constructor Details

    • LogFilter

      public LogFilter(Context context, LogService logService)
      Constructor.
      Parameters:
      context - The context.
      logService - The log service descriptor.
  • Method Details

    • 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.