Hi Amar,
As Christopher points out, you do not seem to need a custom logging filter.
What you want is to make a logger called
"com.sun.jersey.api.container.filter.LoggingFilter"
(that is the name of the logger used by the jersey logging filter)
use a file handler instead of the console handler.
HTH,
~Jakub
On 21.10.2011 18:09, Christopher Currie wrote:
> 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?
>