users@jersey.java.net

Re: [Jersey] LoggingFilter

From: Ricardo Borillo <borillo_at_si.uji.es>
Date: Mon, 15 Feb 2010 18:04:42 +0100

Nice!! This approach seems very usefull ...

Thank you a lot for the information provided :)

---
Salut,
====================================
Ricardo Borillo Domenech
http://xml-utils.com
On Mon, Feb 15, 2010 at 17:35, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:
>
> On Feb 15, 2010, at 4:20 PM, Casper Bang wrote:
>
>> Subclass LoggingFilter and check with a regular expression whether to
>> log or not? I do a similar thing for caching filter, it feels a little
>> AOP like. You could probably take this a step further and create a
>> provider such that you can decorate your resources with logging
>> annotations.
>>
>
> Yes, you can use your own defined logging annotations on a resource method
> if you write a ResourceFilterFactory:
>
>  https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/container/filter/package-summary.html
>
> and the request filter sets a property to dynamically enabled/disable
> logging of entities per-request if the annotation is present. Then you could
> modify LoggingFilter to support this property.
>
> On the small chance you are not aware, but it is possible to disable logging
> for all request and response entities:
>
> https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/container/filter/LoggingFilter.html#FEATURE_LOGGING_DISABLE_ENTITY
>
>
> An alternative is to set a max size of request or response entity to be
> written, say up to the first 2Kb of entity are written. This is really easy
> to implement.
>
> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
>