On Fri, Oct 21, 2011 at 4:29 AM, Amar Bhosale <amarmbhosale_at_gmail.com> wrote:
> I am using Jersey 1.8 (JAX-RS) for REST web services development. While
> doing it, i want to log all incoming requests and responses into a file and
> so i tried to use LoggingFilter.java. But by default, it logs on System.out
> rather than file.
>
> So i wrote one more Filter extending default LoggingFilter class and make
> appropriate entry of new filter in web.xml
I don't understand why a new class was needed here, if the stated goal
is to change where log messages are written. You appear to be
replacing one java.util.logging.Logger object for another, presumably
one that has been configured differently. But you can control the
logging destination for LoggingFilter in the same way:
http://download.oracle.com/javase/6/docs/technotes/guides/logging/overview.html
Or is there another goal that is not reflected in the code?