users@jersey.java.net

[Jersey] Re: LoggingFilter is not being invoked

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Thu, 03 Nov 2011 16:50:16 +0100

Hi Odelya,

The following parameter should be sufficient, you do not need the third
one bellow:

<init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>
</init-param>

On the other hand, i do not think the 3rd parameter would block logging.
Is you application working fine otherwise? I mean, the resources are
accessible?
If not, there might be a bug in e.g. the servlet mapping. If yes, i
would probably need
a small reproducible test case to be able to help you.

~Jakub

On 26.10.2011 10:52, Odelya Holiday wrote:
> I would like to enable logging filter to print the requests and responses.
>
> so I added the following;
>
> <servlet>
> <servlet-name>Jersey Web Application</servlet-name>
> <servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
> <init-param>
> <param-name>com.sun.jersey.config.property.packages</param-name>
> <param-value>com.my.resource</param-value>
> </init-param>
> <init-param>
> <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
> <param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>
> </init-param>
> <init-param>
> <param-name>com.sun.jersey.api.container.filter.LoggingFilter</param-name>
> <param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>
> </init-param>
> <load-on-startup>1</load-on-startup>
> </servlet>
>
> However, no logs are being written anywhere!
>
> I also put a breakpoint in LoggingFilter and the class is being
> initialized but Filter method is never being called!
>
> What could be the problem?
> --
> what matters most is how you see yourself
>