com.sun.jersey.api.client.filter
Class LoggingFilter

java.lang.Object
  extended by com.sun.jersey.api.client.filter.ClientFilter
      extended by com.sun.jersey.api.client.filter.LoggingFilter
All Implemented Interfaces:
ClientHandler

public class LoggingFilter
extends ClientFilter

A logging filter.

Author:
Paul.Sandoz@Sun.Com

Constructor Summary
LoggingFilter()
          Create a logging filter logging the request and response to a default JDK logger, named as the fully qualified class name of this class.
LoggingFilter(java.util.logging.Logger logger)
          Create a logging filter logging the request and response to a JDK logger.
LoggingFilter(java.util.logging.Logger logger, int maxEntitySize)
          Create a logging filter logging the request and response to a JDK logger.
LoggingFilter(java.io.PrintStream loggingStream)
          Create a logging filter logging the request and response to print stream.
LoggingFilter(java.io.PrintStream loggingStream, int maxEntitySize)
          Create a logging filter logging the request and response to print stream.
 
Method Summary
 ClientResponse handle(ClientRequest request)
          Handle a HTTP request as a ClientRequest and return the HTTP response as a ClientResponse.
 
Methods inherited from class com.sun.jersey.api.client.filter.ClientFilter
getNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingFilter

public LoggingFilter()
Create a logging filter logging the request and response to a default JDK logger, named as the fully qualified class name of this class.


LoggingFilter

public LoggingFilter(java.util.logging.Logger logger)
Create a logging filter logging the request and response to a JDK logger.

Parameters:
logger - the logger to log requests and responses.

LoggingFilter

public LoggingFilter(java.io.PrintStream loggingStream)
Create a logging filter logging the request and response to print stream.

Parameters:
loggingStream - the print stream to log requests and responses.

LoggingFilter

public LoggingFilter(java.util.logging.Logger logger,
                     int maxEntitySize)
Create a logging filter logging the request and response to a JDK logger.

Parameters:
logger - the logger to log requests and responses.
maxEntitySize - maximum number of entity bytes to be logged (and buffered) - if the entity is larger, logging filter will print (and buffer in memory) only the specified number of bytes and print "...more..." string at the end.

LoggingFilter

public LoggingFilter(java.io.PrintStream loggingStream,
                     int maxEntitySize)
Create a logging filter logging the request and response to print stream.

Parameters:
loggingStream - the print stream to log requests and responses.
maxEntitySize - maximum number of entity bytes to be logged (and buffered) - if the entity is larger, logging filter will print (and buffer in memory) only the specified number of bytes and print "...more..." string at the end.
Method Detail

handle

public ClientResponse handle(ClientRequest request)
                      throws ClientHandlerException
Description copied from interface: ClientHandler
Handle a HTTP request as a ClientRequest and return the HTTP response as a ClientResponse.

Specified by:
handle in interface ClientHandler
Specified by:
handle in class ClientFilter
Parameters:
request - the HTTP request.
Returns:
the HTTP response.
Throws:
ClientHandlerException - if the client handler fails to process the request or response.


Copyright © 2014 Oracle Corporation. All Rights Reserved.