users@jersey.java.net

Fixed <was> Re: [Jersey] log HTTP exchanges

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 11 Aug 2009 17:18:55 +0200

Hi,

This is fixed in the trunk for the client and server side. TODO:
optionally log entities on the client side.

Paul.

On Aug 10, 2009, at 4:26 PM, Paul Sandoz wrote:

>
> On Aug 9, 2009, at 1:59 PM, Paul Sandoz wrote:
>
>> Hi,
>>
>> I looked briefly into this and it should be rather easy to modify,
>> but i have one question.
>>
>> Do people think it appropriate log the request and response
>> entities? There is no way to stream out the entities, so it
>> requires that they are buffered as String instances. For large
>> requests/responses this may be problematic but perhaps that is the
>> cost of logging? also there could be a feature to turn off entity
>> logging.
>>
>
> This is fixed in the trunk (JavaDoc below).
>
> Client side will be fixed tomorrow.
>
> Paul.
>
> /**
> * A logging filter.
> * <p>
> * The request headers, request entity, response headers and response
> entity
> * will be logged. By default logging will be output to System.out.
> * <p>
> * When an application is deployed as a Servlet or Filter this Jersey
> filter can be
> * registered using the following initialization parameters:
> * <blockquote><pre>
> * &lt;init-param&gt;
> * &lt;param-
> name&gt;com.sun.jersey.spi.container.ContainerRequestFilters&lt;/
> param-name&gt;
> * &lt;param-
> value&gt;com.sun.jersey.api.container.filter.LoggingFilter&lt;/param-
> value&gt;
> * &lt;/init-param&gt
> * &lt;init-param&gt
> * &lt;param-
> name&gt;com.sun.jersey.spi.container.ContainerResponseFilters&lt;/
> param-name&gt;
> * &lt;param-
> value&gt;com.sun.jersey.api.container.filter.LoggingFilter&lt;/param-
> value&gt;
> * &lt;/init-param&gt;
> * </pre></blockquote>
> * <p>
> * The logging of entities may be disabled by setting the feature
> * {_at_link #FEATURE_LOGGING_DISABLE_ENTITY} to true. When an
> application is
> * deployed as a Servlet or Filter this Jersey filter can be
> * registered using the following initialization parameter:
> * <blockquote><pre>
> * &lt;init-param&gt;
> * &lt;param-
> name
> &gt;com.sun.jersey.config.feature.logging.DisableEntitylogging&lt;/
> param-name&gt;
> * &lt;param-value&gt;true&lt;/param-value&gt;
> * &lt;/init-param&gt
> * </pre></blockquote>
> *
> * @author Paul.Sandoz_at_Sun.Com
> * @see com.sun.jersey.api.container.filter
> */
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>